*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #141e30, #243b55);
  color: #f7f7ff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

html,
body {
  width: 100%;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

input {
  font-family: inherit;
}

.hero {
  padding: 3rem 1.5rem 2rem;
  background: linear-gradient(135deg, #111827 0%, #1f2933 40%, #374151 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.15), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  z-index: 2;
}

.hero-artifacts {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.artifact {
  position: absolute;
}

.artifact-orb {
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.65;
}

.artifact-orb-1 {
  width: 240px;
  height: 240px;
  top: -60px;
  left: -40px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.38), rgba(56, 189, 248, 0));
}

.artifact-orb-2 {
  width: 280px;
  height: 280px;
  right: -80px;
  top: -95px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0));
}

.artifact-orb-3 {
  width: 180px;
  height: 180px;
  left: 38%;
  top: 24px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0));
}

.artifact-ring {
  width: 340px;
  height: 340px;
  right: 14%;
  top: -130px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  animation: spinSlow 22s linear infinite;
}

.artifact-grid {
  width: 240px;
  height: 140px;
  right: 12%;
  bottom: 62px;
  opacity: 0.15;
  background-image: linear-gradient(rgba(148, 163, 184, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.7) 1px, transparent 1px);
  background-size: 16px 16px;
  transform: perspective(240px) rotateX(22deg) rotateY(-12deg);
}

.artifact-line {
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(56, 189, 248, 0.8), rgba(148, 163, 184, 0));
  opacity: 0.45;
}

.artifact-line-1 {
  top: 48px;
  left: 52%;
}

.artifact-line-2 {
  top: 82px;
  left: 56%;
  width: 120px;
  opacity: 0.4;
}

.artifact-wave {
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 95px;
  fill: rgba(15, 23, 42, 0.24);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.58rem 0.9rem;
  border-radius: 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.95);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.62));
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.32);
  backdrop-filter: blur(12px);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
  min-height: 2.35rem;
  position: relative;
  overflow: hidden;
}

.hero-badge::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.38rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.0), rgba(56, 189, 248, 0.65), rgba(99, 102, 241, 0.6), rgba(34, 197, 94, 0.0));
  opacity: 0.65;
  transform: scaleX(0.72);
  transform-origin: center;
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}

.hero-badge:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.78), rgba(15, 23, 42, 0.66));
  border-color: rgba(147, 197, 253, 0.62);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.42);
}

.hero-badge:hover::after {
  opacity: 0.95;
  transform: scaleX(1);
}

.badge-icon {
  font-size: 0.95rem;
  line-height: 1;
  color: rgba(125, 211, 252, 0.95);
  display: inline-block;
  /* Ensure Font Awesome glyph renders even inside flex */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.badge-icon::before {
  display: block;
}

.app-title {
  font-size: clamp(2.4rem, 3.6vw, 3.2rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}

.app-tagline {
  margin: 0 0 1.5rem;
  font-weight: 300;
  color: #c4d0ff;
}

.app-intro {
  max-width: 640px;
  margin: 0 0 1.75rem;
  line-height: 1.7;
  color: #d8e2ff;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.highlight-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 1rem;
  padding: 1rem 1rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(18px);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.highlight-card h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.card-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: #93c5fd;
}

.highlight-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #d1d5db;
}

.highlight-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.9);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.95);
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease,
    border-color 150ms ease, color 150ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0f172a;
  box-shadow: 0 14px 40px rgba(59, 130, 246, 0.55);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(59, 130, 246, 0.75);
}

.secondary-btn {
  background: transparent;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.secondary-btn:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 1);
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
  backdrop-filter: blur(12px);
}

.theme-toggle:hover {
  background: rgba(30, 64, 175, 0.85);
  border-color: rgba(191, 219, 254, 0.9);
}

.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  width: 100%;
}

.dashboard-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.dashboard-header p {
  margin: 0 0 1.5rem;
  color: #d1d5db;
  font-size: 0.95rem;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

.search-group {
  display: flex;
  flex: 1 1 220px;
  gap: 0.5rem;
}

#cityInput {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0.7rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  outline: none;
  min-width: 0;
}

#cityInput::placeholder {
  color: #6b7280;
}

#cityInput:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
}

.helper-text {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.status-message {
  min-height: 1.2rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.status-message.error {
  color: #fecaca;
}

.status-message.info {
  color: #bfdbfe;
}

.city-matches {
  margin: -0.25rem 0 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.7);
}

.city-matches-header {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 0.55rem;
}

.city-matches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.city-match-btn {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e5e7eb;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.city-match-btn:hover {
  transform: translateY(-1px);
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.75);
}

.city-match-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(99, 102, 241, 0.28));
  border-color: rgba(56, 189, 248, 0.85);
}

.cards-grid {
  display: grid;
  grid-template-columns: 2fr 1.6fr;
  gap: 1.25rem;
}

.cards-grid > * {
  min-width: 0;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 1.2rem;
  padding: 1.25rem 1.25rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(18px);
  animation: cardIn 350ms ease-out;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.weather-main {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.weather-location {
  margin: 0 0 0.1rem;
  font-weight: 500;
}

.weather-temp {
  margin: 0 0 0.2rem;
  font-size: 2.3rem;
}

.weather-desc {
  margin: 0;
  color: #d1d5db;
  font-size: 0.95rem;
}

.weather-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  min-width: 70px;
  min-height: 70px;
}

.weather-icon-animated {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(88px, 22vw);
  height: min(88px, 22vw);
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.35));
}

.weather-icon-animated .wx-meteocon {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  pointer-events: none;
  object-fit: contain;
}

.hourly-icon-wrap {
  width: 46px;
  height: 46px;
  margin: 0 auto 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hourly-icon-wrap .weather-icon-animated {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.4));
}

.forecast-day-icon-wrap {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forecast-day-icon-wrap .weather-icon-animated {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.4));
}

.hidden {
  display: none;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.weather-details .label {
  display: block;
  color: #9ca3af;
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}

.updated-time {
  margin: 0;
  font-size: 0.78rem;
  color: #9ca3af;
}
.show-graph-btn {
  margin-top: 0.85rem;
  width: 100%;
}
.show-graph-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cards-grid #alertsCard {
  grid-column: 1 / -1;
  order: 99;
}

.cards-grid #hourlyCard {
  grid-column: 1 / -1;
}

.cards-grid #forecastCard {
  grid-column: 1 / -1;
}

.weather-alerts-card {
  overflow: hidden;
  padding: 0;
  border-width: 1px;
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.95), 0 0 0 1px rgba(148, 163, 184, 0.1);
}

.weather-alerts-card .weather-alerts-banner {
  margin: 0;
  padding: 1.1rem 1.25rem 1.15rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.5) 0%, rgba(30, 41, 59, 0.95) 55%, rgba(15, 23, 42, 0.98) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.weather-alerts-banner-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: linear-gradient(145deg, rgba(148, 163, 184, 0.3), rgba(51, 65, 85, 0.35));
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
  font-size: 1.35rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.weather-alerts-banner-glyph {
  display: block;
  line-height: 1;
  font-size: 1.2rem;
}

.weather-alerts-banner-text h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  color: #fffbeb;
}

.weather-alerts-lead {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #94a3b8;
  opacity: 0.95;
}

.weather-alerts-lead strong {
  color: #e2e8f0;
  font-weight: 600;
}

.wx-alerts-feed {
  padding: 1rem 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 4rem;
  background: rgba(15, 23, 42, 0.55);
}

.wx-alert-block {
  display: flex;
  gap: 0;
  align-items: stretch;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.75);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.wx-alert-accent {
  width: 5px;
  flex-shrink: 0;
}

.wx-alert-severe .wx-alert-accent {
  background: linear-gradient(180deg, #f87171, #dc2626, #991b1b);
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.35);
}

.wx-alert-warning .wx-alert-accent {
  background: linear-gradient(180deg, #64748b, #334155);
}

.wx-alert-info .wx-alert-accent {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
}

.wx-alert-inner {
  flex: 1;
  padding: 0.75rem 0.9rem 0.85rem 0.95rem;
  min-width: 0;
}

.wx-alert-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}

.wx-alert-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e2e8f0;
  background: linear-gradient(90deg, #64748b, #475569);
  padding: 0.28rem 0.55rem;
  border-radius: 0.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wx-alert-severe .wx-alert-pill {
  background: linear-gradient(90deg, #fecaca, #f87171);
  color: #450a0a;
}

.wx-alert-info .wx-alert-pill {
  background: linear-gradient(90deg, #bae6fd, #7dd3fc);
  color: #0c4a6e;
}

.wx-alert-icon {
  font-size: 1.15rem;
  color: #94a3b8;
  opacity: 0.9;
}

.wx-alert-severe .wx-alert-icon {
  color: #fca5a5;
}

.wx-alert-warning .wx-alert-icon {
  color: #cbd5e1;
}

.wx-alert-info .wx-alert-icon {
  color: #7dd3fc;
}

.wx-alert-headline {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.3;
}

.wx-alert-detail {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.wx-alerts-empty-state {
  padding: 0.35rem 0 0.15rem;
  text-align: center;
}

.wx-alerts-empty-title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}

.wx-alerts-empty-desc {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #94a3b8;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.wx-alerts-demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.wx-demo-chip {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.6);
}

.wx-demo-severe {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.2);
}

.wx-demo-warning {
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
  background: rgba(51, 65, 85, 0.28);
}

.wx-demo-wind {
  border-color: rgba(56, 189, 248, 0.4);
  color: #bae6fd;
  background: rgba(12, 74, 110, 0.25);
}

.weather-alerts-footer {
  margin: 0;
  padding: 0.9rem 1.25rem 1.15rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.65);
}

.notify-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #d1d5db;
  cursor: pointer;
  line-height: 1.45;
}

.notify-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: #38bdf8;
}

.notify-hint {
  margin: 0.45rem 0 0 1.6rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

@media (min-width: 640px) {
  .weather-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hourly-timeline {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem 0.15rem 0.2rem;
  scroll-snap-type: x mandatory;
}

.hourly-timeline::-webkit-scrollbar {
  height: 8px;
}

.hourly-timeline::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.hourly-item {
  flex: 0 0 auto;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.9rem;
  padding: 0.85rem 0.85rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  text-align: center;
  scroll-snap-align: start;
}

.hourly-time {
  font-weight: 500;
  color: #e5e7eb;
  font-size: 0.86rem;
  margin-bottom: 0.25rem;
}

.hourly-temp {
  font-size: 0.9rem;
  color: #f3f4f6;
  margin-bottom: 0.15rem;
}

.hourly-desc {
  margin: 0;
  font-size: 0.78rem;
  color: #9ca3af;
}

.forecast-summary {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.forecast-day {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.9rem;
  padding: 0.85rem 0.75rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  text-align: center;
  font-size: 0.85rem;
}

.forecast-day-label {
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.forecast-day-temp {
  margin: 0.1rem 0;
  font-size: 0.8rem;
  color: #e5e7eb;
}

.forecast-day-desc {
  margin: 0;
  font-size: 0.78rem;
  color: #9ca3af;
}

.prep-summary {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.prep-details {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.prep-block h4 {
  margin: 0 0 0.15rem;
  font-size: 0.96rem;
}

.prep-block p {
  margin: 0;
  font-size: 0.88rem;
  color: #d1d5db;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .hero-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .card {
    padding: 1.1rem 1.1rem 1.3rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 2.4rem;
  }

  .hero-highlights {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-row {
    flex-direction: column;
  }

  .search-group {
    width: 100%;
  }

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

@media (max-width: 575px) {
  body {
    font-size: 15px;
  }

  .hero {
    padding: 2.2rem 0.85rem 1.5rem;
  }

  .theme-toggle {
    top: 0.7rem;
    right: 1rem;
  }

  .dashboard {
    padding: 1.2rem 0.85rem 2rem;
  }

  .app-title {
    font-size: 1.85rem;
  }

  .app-tagline,
  .app-intro,
  .dashboard-header p {
    font-size: 0.9rem;
  }

  .artifact-ring {
    width: 220px;
    height: 220px;
    right: -60px;
    top: -70px;
  }

  .artifact-grid,
  .artifact-line,
  .artifact-orb-3 {
    display: none;
  }

  .artifact-wave {
    height: 70px;
  }

  .hero-badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.85rem;
  }

  .hero-badge {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.78rem;
    padding: 0.56rem 0.72rem;
    border-radius: 0.85rem;
    min-height: 2.45rem;
  }

  .hero-badge::after {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.34rem;
  }

  .badge-icon {
    font-size: 0.92rem;
  }

  .search-group {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  #cityInput {
    width: 100%;
  }

  #cityInput {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 0.9rem !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
  }

  .card {
    padding: 1rem;
    border-radius: 0.9rem;
  }

  .weather-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .weather-temp {
    font-size: 2rem;
  }

  .weather-details {
    grid-template-columns: 1fr;
  }

  .forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .forecast-day {
    padding: 0.75rem 0.45rem 0.8rem;
    font-size: 0.78rem;
  }

  .forecast-day-icon-wrap,
  .forecast-day-icon-wrap .weather-icon-animated {
    width: 40px;
    height: 40px;
  }

  .hourly-item {
    min-width: 116px;
    padding: 0.75rem 0.7rem 0.85rem;
  }

  .hourly-icon-wrap,
  .hourly-icon-wrap .weather-icon-animated {
    width: 40px;
    height: 40px;
  }

  .city-matches-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .city-match-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 359px) {
  .hero-badges {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 576px) and (max-width: 991px) {
  .dashboard,
  .hero-content {
    max-width: 100%;
  }

  .dashboard {
    padding: 1.75rem 1.25rem 2.35rem;
  }

  .hero {
    padding: 2.6rem 1.25rem 1.9rem;
  }

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

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

  .search-group {
    flex: 1 1 100%;
  }

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

@media (min-width: 992px) and (max-width: 1279px) {
  .hero-content,
  .dashboard {
    max-width: 1100px;
  }

  .cards-grid {
    grid-template-columns: 1.7fr 1.3fr;
  }

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

@media (min-width: 1280px) {
  .hero-content,
  .dashboard {
    max-width: 1240px;
  }

  .hero {
    padding: 3.25rem 2rem 2.2rem;
  }

  .dashboard {
    padding: 2.2rem 2rem 3.2rem;
  }

  .cards-grid {
    grid-template-columns: 1.8fr 1.2fr;
    gap: 1.4rem;
  }

  .hourly-item {
    min-width: 154px;
  }
}

@media (max-width: 359px) {
  .app-title {
    font-size: 1.65rem;
  }

  .hero-badge {
    width: 100%;
    justify-content: center;
  }

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

@media (orientation: landscape) and (max-height: 500px) {
  .hero {
    padding-top: 1.6rem;
  }

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

html.theme-light body {
  background: radial-gradient(circle at top left, #e0f2fe, #f9fafb);
  color: #020617;
}

html.theme-light .hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 40%, #bfdbfe 100%);
}

html.theme-light .hero::before {
  background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.4), transparent 55%);
}

html.theme-light .artifact-wave {
  fill: rgba(255, 255, 255, 0.72);
}

html.theme-light .artifact-ring {
  border-color: rgba(59, 130, 246, 0.3);
}

html.theme-light .artifact-grid {
  opacity: 0.13;
}

html.theme-light .artifact-line {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(37, 99, 235, 0.75), rgba(148, 163, 184, 0));
}

html.theme-light .hero-badge {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 249, 0.82));
  color: rgba(15, 23, 42, 0.86);
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: 0 12px 26px rgba(148, 163, 184, 0.22);
}

html.theme-light .badge-icon,
html.theme-light .card-icon {
  color: #1d4ed8;
}

html.theme-light .hero-badge::after {
  opacity: 0.55;
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.0), rgba(29, 78, 216, 0.55), rgba(99, 102, 241, 0.45), rgba(29, 78, 216, 0.0));
}

html.theme-light .hero-badge:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.3);
}

html.theme-light .badge-icon {
  color: rgba(15, 23, 42, 0.82);
}

html.theme-light .weather-icon-animated {
  filter: drop-shadow(0 10px 22px rgba(37, 99, 235, 0.22)) contrast(1.32) saturate(1.35) brightness(1.06);
}

html.theme-light .weather-icon-animated {
  width: min(96px, 26vw);
  height: min(96px, 26vw);
}

html.theme-light .weather-icon-wrapper,
html.theme-light .hourly-icon-wrap,
html.theme-light .forecast-day-icon-wrap {
  background: radial-gradient(circle at 30% 25%, rgba(37, 99, 235, 0.22), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  border-radius: 1rem;
}

html.theme-light .weather-icon-wrapper {
  padding: 0.25rem;
}

html.theme-light .hourly-icon-wrap,
html.theme-light .forecast-day-icon-wrap {
  padding: 0.18rem;
}

html.theme-light .hourly-icon-wrap .weather-icon-animated,
html.theme-light .forecast-day-icon-wrap .weather-icon-animated {
  filter: drop-shadow(0 4px 10px rgba(148, 163, 184, 0.35));
}

html.theme-light .app-tagline,
html.theme-light .app-intro {
  color: #1e293b;
}

html.theme-light .highlight-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 18px 45px rgba(148, 163, 184, 0.4);
}

html.theme-light .highlight-card p {
  color: #4b5563;
}

html.theme-light .secondary-btn {
  background: #ffffff;
  color: #111827;
}

html.theme-light .dashboard-header p,
html.theme-light .helper-text {
  color: #4b5563;
}

html.theme-light .card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 18px 45px rgba(148, 163, 184, 0.35);
}

html.theme-light .weather-alerts-card {
  border-color: rgba(217, 119, 6, 0.35);
  box-shadow: 0 18px 45px rgba(251, 191, 36, 0.15), 0 0 0 1px rgba(251, 191, 36, 0.2);
}

html.theme-light .weather-alerts-card .weather-alerts-banner {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.95) 0%, rgba(255, 251, 235, 0.98) 50%, #ffffff 100%);
  border-bottom-color: rgba(251, 191, 36, 0.35);
}

html.theme-light .weather-alerts-banner-icon {
  background: linear-gradient(145deg, #fef3c7, #fde68a);
  border-color: rgba(217, 119, 6, 0.35);
  color: #b45309;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.2);
}

html.theme-light .weather-alerts-banner-text h3 {
  color: #78350f;
}

html.theme-light .weather-alerts-lead {
  color: #92400e;
}

html.theme-light .weather-alerts-lead strong {
  color: #451a03;
}

html.theme-light .wx-alerts-feed {
  background: #f8fafc;
}

html.theme-light .wx-alert-block {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 8px 24px rgba(148, 163, 184, 0.2);
}

html.theme-light .wx-alert-headline {
  color: #0f172a;
}

html.theme-light .wx-alert-detail {
  color: #475569;
}

html.theme-light .wx-alert-icon {
  color: #64748b;
}

html.theme-light .wx-alert-severe .wx-alert-icon {
  color: #dc2626;
}

html.theme-light .wx-alert-warning .wx-alert-icon {
  color: #d97706;
}

html.theme-light .wx-alert-info .wx-alert-icon {
  color: #0284c7;
}

html.theme-light .wx-alerts-empty-title {
  color: #1e293b;
}

html.theme-light .wx-alerts-empty-desc {
  color: #64748b;
}

html.theme-light .wx-demo-chip {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.45);
  color: #475569;
}

html.theme-light .wx-demo-severe {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.35);
  color: #991b1b;
}

html.theme-light .wx-demo-warning {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}

html.theme-light .wx-demo-wind {
  background: #f0f9ff;
  border-color: rgba(2, 132, 199, 0.35);
  color: #0369a1;
}

html.theme-light .weather-alerts-footer {
  background: #ffffff;
  border-top-color: rgba(148, 163, 184, 0.35);
}

html.theme-light .notify-label {
  color: #334155;
}

html.theme-light .status-message.info {
  color: #1d4ed8;
}

html.theme-light .status-message.error {
  color: #b91c1c;
}

html.theme-light .city-matches {
  background: #ffffff;
}

html.theme-light .weather-desc,
html.theme-light .prep-summary,
html.theme-light .prep-block p,
html.theme-light .forecast-summary,
html.theme-light .forecast-day-temp,
html.theme-light .forecast-day-desc,
html.theme-light .hourly-temp,
html.theme-light .hourly-desc {
  color: #111827;
}

html.theme-light .weather-details .label,
html.theme-light .updated-time {
  color: #6b7280;
}

html.theme-light .hourly-item,
html.theme-light .forecast-day {
  background: #f9fafb;
}

html.theme-light .hourly-time {
  color: #111827;
}

@media (prefers-reduced-motion: reduce) {
  .artifact-ring,
  .highlight-card,
  .primary-btn,
  .secondary-btn,
  .hero-badge {
    animation: none;
    transition: none;
  }

}