:root {
  color-scheme: light;
  --bg: #e9f0f3;
  --surface: #f8fbfc;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --ink: #132126;
  --muted: #64727b;
  --line: rgba(19, 33, 38, 0.12);
  --accent: #0b6f6d;
  --accent-strong: #074f4e;
  --accent-soft: #dff3ef;
  --sun: #eda92e;
  --rain: #2c76b7;
  --danger: #8a2f24;
  --warning: #b76b12;
  --ok: #247d55;
  --shadow: 0 14px 32px rgba(25, 43, 50, 0.12);
  --sky-top: rgba(11, 111, 109, 0.14);
  --sky-mid: rgba(255, 255, 255, 0.28);
  --sky-bottom: rgba(233, 240, 243, 0);
  --weather-line: rgba(11, 111, 109, 0.16);
  --panel-glow: rgba(11, 111, 109, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  position: relative;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--sky-top) 0, var(--sky-mid) 180px, var(--sky-bottom) 430px),
    var(--bg);
  transition: background 700ms ease, color 300ms ease;
  -webkit-font-smoothing: antialiased;
}

body[data-weather="sun"],
body[data-weather="sun-cloud"] {
  --sky-top: rgba(237, 169, 46, 0.28);
  --sky-mid: rgba(255, 248, 232, 0.7);
  --weather-line: rgba(237, 169, 46, 0.2);
  --panel-glow: rgba(237, 169, 46, 0.12);
}

body[data-weather="rain"],
body[data-weather="drizzle"],
body[data-weather="storm"] {
  --sky-top: rgba(44, 118, 183, 0.24);
  --sky-mid: rgba(216, 230, 240, 0.72);
  --weather-line: rgba(44, 118, 183, 0.22);
  --panel-glow: rgba(44, 118, 183, 0.1);
}

body[data-weather="fog"],
body[data-weather="cloud"] {
  --sky-top: rgba(100, 114, 123, 0.18);
  --sky-mid: rgba(238, 243, 245, 0.82);
  --weather-line: rgba(100, 114, 123, 0.18);
  --panel-glow: rgba(100, 114, 123, 0.08);
}

body[data-weather="snow"] {
  --sky-top: rgba(106, 166, 200, 0.2);
  --sky-mid: rgba(248, 252, 255, 0.9);
  --weather-line: rgba(106, 166, 200, 0.2);
  --panel-glow: rgba(106, 166, 200, 0.1);
}

body[data-day="night"] {
  --bg: #d9e2e7;
  --sky-top: rgba(42, 58, 76, 0.28);
  --sky-mid: rgba(205, 217, 225, 0.58);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  height: 420px;
  background:
    linear-gradient(120deg, transparent 0 18%, var(--weather-line) 18% 19%, transparent 19% 52%, rgba(255,255,255,0.22) 52% 53%, transparent 53%),
    linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0));
  background-size: 320px 320px, 100% 100%;
  opacity: 0.48;
  animation: skyDrift 18s linear infinite;
}

body::after {
  opacity: 0;
}

body[data-weather="rain"]::after,
body[data-weather="drizzle"]::after,
body[data-weather="storm"]::after {
  background-image: repeating-linear-gradient(115deg, rgba(44,118,183,0.2) 0 1px, transparent 1px 15px);
  background-size: 180px 180px;
  opacity: 0.34;
  animation: rainFall 900ms linear infinite;
}

body[data-weather="drizzle"]::after {
  opacity: 0.18;
  animation-duration: 1400ms;
}

body[data-weather="snow"]::after {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 40%, rgba(255,255,255,0.7) 0 1px, transparent 1.5px);
  background-size: 78px 96px, 110px 130px;
  opacity: 0.56;
  animation: snowFall 12s linear infinite;
}

body[data-weather="fog"]::after,
body[data-weather="cloud"]::after {
  height: 520px;
  background-image: repeating-linear-gradient(0deg, transparent 0 36px, rgba(255,255,255,0.32) 36px 38px, transparent 38px 74px);
  opacity: 0.42;
  animation: fogDrift 14s ease-in-out infinite alternate;
}

body[data-weather="storm"]::before {
  animation: skyDrift 18s linear infinite, stormFlash 7s ease-in-out infinite;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

button:active {
  transform: scale(0.97);
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 10px calc(22px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  overflow-x: clip;
  position: relative;
  z-index: 1;
}

.app-shell > * {
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(233, 240, 243, 0.86);
  border-bottom: 1px solid rgba(19, 33, 38, 0.08);
  backdrop-filter: blur(18px);
}

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

.app-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(145deg, #fff8e6, #e1f4ef);
  box-shadow: inset 0 0 0 1px rgba(19, 33, 38, 0.08);
  color: var(--sun);
}

.icon-svg {
  display: block;
  flex: 0 0 auto;
}

.ui-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon.large {
  width: 44px;
  height: 44px;
  stroke-width: 1.85;
}

.ui-icon .icon-filled {
  fill: currentColor;
  stroke: currentColor;
}

.weather-icon {
  width: 100%;
  height: 100%;
}

.weather-icon.mini {
  width: 30px;
  height: 30px;
}

.weather-icon.large {
  width: clamp(54px, 16vw, 70px);
  height: clamp(54px, 16vw, 70px);
}

.icon-stroke {
  fill: none;
  stroke: #376872;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sun {
  fill: #f5c052;
  stroke: #d99016;
  stroke-width: 3;
}

.icon-sun-ray {
  stroke: #d99016;
  stroke-width: 3;
}

.icon-cloud {
  fill: #dce7ec;
}

.icon-rain,
.icon-snow,
.icon-fog {
  fill: none;
  stroke: var(--rain);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fog {
  stroke: #6f8792;
}

.icon-snow {
  stroke: #6aa6c8;
}

.icon-bolt {
  fill: #eda92e;
  stroke: #9f5d00;
  stroke-width: 2;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.source-pill {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid rgba(11, 111, 109, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(25, 43, 50, 0.08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #24a148;
  box-shadow: 0 0 0 4px rgba(36, 161, 72, 0.12);
  flex: 0 0 auto;
  animation: signalPulse 2.6s ease-in-out infinite;
}

.search-panel,
.current-panel,
.forecast-section,
.details-section,
.alerts-section,
.history-section,
.saved-section,
.summary-section,
.health-section,
.insights-section {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow), 0 0 0 1px var(--panel-glow);
  backdrop-filter: blur(16px);
  animation: cardIn 420ms ease both;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.search-panel:hover,
.current-panel:hover,
.forecast-section:hover,
.details-section:hover,
.alerts-section:hover,
.saved-section:hover,
.summary-section:hover,
.health-section:hover,
.insights-section:hover {
  border-color: rgba(11, 111, 109, 0.18);
  box-shadow: 0 18px 36px rgba(25, 43, 50, 0.14), 0 0 0 1px var(--panel-glow);
}

.search-panel {
  padding: 8px;
  position: relative;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
}

.search-form input {
  min-width: 0;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.search-form input:focus {
  border-color: rgba(11, 111, 109, 0.52);
  box-shadow: 0 0 0 4px rgba(11, 111, 109, 0.12);
}

.search-form button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.search-form button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 20px rgba(11, 111, 109, 0.18);
}

.search-form .ghost-button {
  grid-column: 1 / -1;
  border: 1px solid rgba(11, 111, 109, 0.22);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.quick-actions,
.city-chips,
.preference-actions {
  display: inline-flex;
  gap: 6px;
  margin-top: 8px;
}

.settings-toggle {
  min-height: 38px;
  margin-top: 8px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(11, 111, 109, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.settings-toggle:hover,
.city-chips button:hover,
.favorite-toggle:hover,
.collapse-toggle:hover {
  border-color: rgba(11, 111, 109, 0.34);
  box-shadow: 0 8px 18px rgba(25, 43, 50, 0.1);
  transform: translateY(-1px);
}

.settings-panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(11, 111, 109, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.settings-panel[hidden] {
  display: none;
}

.quick-actions {
  padding: 3px;
  border-radius: 8px;
  background: rgba(11, 111, 109, 0.08);
}

.unit-toggle {
  min-width: 46px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 900;
  cursor: pointer;
}

.unit-toggle.is-active {
  background: var(--panel-strong);
  box-shadow: 0 1px 8px rgba(25, 43, 50, 0.1);
}

.suggestions-panel {
  position: absolute;
  top: 64px;
  left: 8px;
  right: 8px;
  z-index: 20;
  max-height: 244px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(11, 111, 109, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(25, 43, 50, 0.2);
}

.suggestions-panel[hidden] {
  display: none;
}

.suggestions-panel button {
  min-height: 48px;
  padding: 9px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid rgba(11, 111, 109, 0.14);
  border-radius: 8px;
  background: rgba(248, 251, 252, 0.96);
  color: var(--ink);
}

.suggestions-panel strong {
  font-size: 0.94rem;
}

.suggestions-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.preference-actions {
  width: 100%;
  flex-wrap: wrap;
  padding-top: 2px;
}

.preference-toggle {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(11, 111, 109, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.preference-toggle.is-active {
  border-color: rgba(11, 111, 109, 0.34);
  background: var(--accent-soft);
}

.city-chips {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.city-chips::-webkit-scrollbar {
  display: none;
}

.city-chips button {
  min-height: 34px;
  padding: 0 12px;
  flex: 0 0 auto;
  border: 1px solid rgba(11, 111, 109, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
}

.history-chips,
.saved-chips {
  display: grid;
  gap: 8px;
}

.history-chips button,
.saved-chips button {
  min-height: 48px;
  padding: 9px 11px;
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid rgba(11, 111, 109, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  cursor: pointer;
}

.history-chips span,
.saved-chips span {
  font-weight: 900;
}

.history-chips small,
.saved-chips small {
  color: var(--muted);
  font-size: 0.75rem;
}

.offline-banner {
  padding: 10px 12px;
  border: 1px solid rgba(44, 118, 183, 0.2);
  border-radius: 8px;
  background: rgba(44, 118, 183, 0.1);
  color: #1f5c90;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.offline-banner[hidden] {
  display: none;
}

.favorite-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.favorite-chip.is-current .favorite-card {
  border-color: rgba(237, 169, 46, 0.55);
  background: #fff8e8;
}

.favorite-card {
  min-height: 78px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  text-align: left;
  border: 1px solid rgba(11, 111, 109, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.favorite-card span,
.favorite-card strong {
  font-weight: 900;
}

.favorite-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-card strong {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-size: 1.2rem;
}

.favorite-card em {
  grid-column: 1 / -1;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(36, 125, 85, 0.1);
  color: var(--ok);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.favorite-card em.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.favorite-card em.danger {
  background: rgba(138, 47, 36, 0.12);
  color: var(--danger);
}

.remove-favorite {
  min-height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(138, 47, 36, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--danger);
}

.current-panel {
  min-height: 236px;
  padding: 13px;
  display: flex;
  overflow: hidden;
}

.current-weather {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  animation: weatherContentIn 520ms ease both;
}

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

.favorite-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(11, 111, 109, 0.18);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.75);
  color: var(--accent-strong);
}

.favorite-toggle.is-active {
  background: #fff8e8;
  color: var(--sun);
}

.place {
  margin-bottom: 6px;
  font-size: clamp(1rem, 5vw, 1.42rem);
  line-height: 1.12;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.description {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.96rem;
}

.temperature {
  font-size: clamp(3.35rem, 20vw, 5.5rem);
  line-height: 0.84;
  font-weight: 900;
  text-shadow: 0 8px 24px rgba(19, 33, 38, 0.08);
}

.weather-mark {
  width: clamp(68px, 20vw, 88px);
  height: clamp(68px, 20vw, 88px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8e8;
  color: var(--sun);
  box-shadow: inset 0 0 0 1px rgba(237, 169, 46, 0.18), 0 12px 26px rgba(237, 169, 46, 0.16);
  animation: weatherFloat 4.8s ease-in-out infinite;
}

body[data-weather="rain"] .weather-mark,
body[data-weather="drizzle"] .weather-mark {
  background: #e8f3fb;
  box-shadow: inset 0 0 0 1px rgba(44, 118, 183, 0.16), 0 12px 26px rgba(44, 118, 183, 0.14);
}

body[data-weather="cloud"] .weather-mark,
body[data-weather="fog"] .weather-mark {
  background: #eef4f6;
  box-shadow: inset 0 0 0 1px rgba(100, 114, 123, 0.14), 0 12px 26px rgba(100, 114, 123, 0.12);
}

body[data-weather="storm"] .weather-mark {
  animation: weatherFloat 4.8s ease-in-out infinite, iconFlash 7s ease-in-out infinite;
}

.weather-mark .weather-icon {
  filter: drop-shadow(0 4px 7px rgba(19, 33, 38, 0.12));
}

body[data-weather="sun"] .weather-mark .icon-sun-ray,
body[data-weather="sun-cloud"] .weather-mark .icon-sun-ray {
  transform-origin: 24px 24px;
  animation: sunSpin 12s linear infinite;
}

.meta-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.meta-item {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.meta-item:hover,
.hour-card:hover,
.day-card:hover,
.tomorrow-card:hover,
.detail-card:hover,
.health-card:hover,
.insight-card:hover,
.trend-card:hover,
.summary-card:hover,
.alert-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(25, 43, 50, 0.1);
}

.meta-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.meta-value {
  font-size: 0.94rem;
  font-weight: 900;
}

.forecast-section,
.details-section,
.alerts-section,
.history-section,
.saved-section,
.summary-section,
.health-section,
.insights-section {
  padding: 15px 12px 12px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.section-heading span i {
  display: block;
  margin-top: 3px;
  font-style: normal;
}

.heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.heading-actions em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.reliability-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.reliability-pill.high {
  background: rgba(36, 125, 85, 0.12);
  color: var(--ok);
}

.reliability-pill.medium {
  background: rgba(44, 118, 183, 0.12);
  color: #1f5c90;
}

.reliability-pill.low {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warning);
}

.hourly-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 3px;
}

.hourly-strip::-webkit-scrollbar {
  display: none;
}

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

.hour-card {
  min-height: 156px;
  padding: 11px 8px;
  text-align: center;
  scroll-snap-align: start;
}

.hour-card time,
.day-date {
  color: var(--muted);
  font-size: 0.78rem;
}

.mini-icon {
  margin: 9px auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}

.hour-temp {
  font-size: 1.1rem;
  font-weight: 900;
}

.feels-line {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.day-card {
  min-height: 76px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(82px, auto);
  align-items: center;
  gap: 10px;
}

.day-name {
  font-weight: 900;
  text-transform: capitalize;
  line-height: 1.15;
}

.day-temps {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-weight: 900;
}

.day-temps span:last-child {
  color: var(--muted);
}

.rain-line {
  color: var(--rain);
  font-size: 0.8rem;
  white-space: nowrap;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.official-alert {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.official-alert-card {
  min-height: 76px;
  padding: 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(44, 118, 183, 0.18);
  border-radius: 8px;
  background: rgba(44, 118, 183, 0.08);
}

.official-alert-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.official-alert-card span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.official-alert-card a {
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.notification-panel {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.notification-panel button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.notification-panel span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.notification-panel button[hidden] {
  display: none;
}

.summary-card {
  min-height: 92px;
  padding: 13px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.health-card {
  min-height: 112px;
  padding: 11px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  border: 1px solid rgba(36, 125, 85, 0.18);
  border-radius: 8px;
  background: rgba(36, 125, 85, 0.08);
}

.health-card span,
.health-card small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.health-card span {
  color: var(--ok);
  font-weight: 900;
  text-transform: uppercase;
}

.health-card strong {
  font-size: 1rem;
  line-height: 1.12;
}

.health-card.warning {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.1);
}

.health-card.warning span {
  color: var(--warning);
}

.health-card.danger {
  border-color: rgba(138, 47, 36, 0.22);
  background: rgba(138, 47, 36, 0.1);
}

.health-card.danger span {
  color: var(--danger);
}

.summary-card strong {
  font-size: 1.04rem;
  line-height: 1.2;
}

.summary-card span,
.summary-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rain-timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.rain-timeline::-webkit-scrollbar {
  display: none;
}

.rain-slot {
  min-height: 98px;
  padding: 10px 8px;
  display: grid;
  align-content: space-between;
  gap: 5px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.rain-slot strong {
  font-size: 0.82rem;
}

.rain-slot span,
.rain-slot small {
  color: var(--muted);
  font-size: 0.76rem;
}

.rain-slot.possible,
.rain-slot.medium {
  border-color: rgba(44, 118, 183, 0.34);
  background: rgba(44, 118, 183, 0.1);
}

.rain-slot.rain,
.rain-slot.strong,
.rain-slot.high {
  border-color: rgba(138, 47, 36, 0.28);
  background: rgba(138, 47, 36, 0.1);
}

.rain-slot.rain strong,
.rain-slot.strong strong,
.rain-slot.possible strong {
  color: var(--rain);
}

.rain-slot:hover {
  transform: translateY(-2px);
}

.tomorrow-grid {
  display: grid;
  gap: 8px;
}

.tomorrow-card {
  min-height: 94px;
  padding: 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.tomorrow-card strong {
  display: block;
  margin-bottom: 4px;
}

.tomorrow-card span,
.tomorrow-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.share-panel {
  margin-top: 8px;
  padding: 10px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(11, 111, 109, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.share-panel button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.share-panel small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.insight-card {
  min-height: 112px;
  padding: 11px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.insight-card span,
.insight-card small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.insight-card strong {
  font-size: 1rem;
  line-height: 1.1;
}

.trend-note {
  margin: -2px 2px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.trend-grid {
  display: grid;
  gap: 8px;
}

.trend-card {
  min-height: 84px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(112px, auto);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.trend-card.low-confidence {
  background: rgba(255, 255, 255, 0.58);
}

.trend-values {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.trend-values strong {
  white-space: nowrap;
}

.trend-values span,
.trend-values small {
  color: var(--muted);
  font-size: 0.76rem;
}

.alert-card {
  min-height: 72px;
  padding: 12px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(36, 125, 85, 0.18);
  border-left: 5px solid var(--ok);
  border-radius: 8px;
  background: rgba(36, 125, 85, 0.08);
}

.alert-card strong {
  font-size: 0.96rem;
}

.alert-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.alert-card.warning {
  border-left-color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.1);
}

.alert-card.danger {
  border-left-color: var(--danger);
  border-color: rgba(138, 47, 36, 0.22);
  background: rgba(138, 47, 36, 0.1);
}

.alert-card.calm {
  border-left-color: var(--ok);
}

.detail-card {
  min-height: 96px;
  padding: 11px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.detail-label,
.detail-hint {
  color: var(--muted);
  font-size: 0.76rem;
}

.detail-card strong {
  font-size: 1.04rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.collapse-toggle {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(11, 111, 109, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.collapsible-content[hidden] {
  display: none;
}

body[data-density="compact"] .details-section,
body[data-density="compact"] .health-section,
body[data-density="compact"] .insights-section,
body[data-density="compact"] .trend-section {
  padding-block: 12px;
}

body[data-density="compact"] .hour-card {
  min-height: 132px;
}

body[data-density="compact"] .meta-grid,
body[data-density="compact"] .details-grid,
body[data-density="compact"] .insights-grid {
  gap: 6px;
}

.data-note {
  margin: 2px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.empty-state,
.error-state,
.permission-state {
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.error-state {
  color: var(--danger);
}

.permission-state {
  color: var(--ink);
}

.permission-state p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.permission-state button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(11, 111, 109, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.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;
}

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

@keyframes skyDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 320px 0, 0 0;
  }
}

@keyframes rainFall {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 180px;
  }
}

@keyframes snowFall {
  from {
    background-position: 0 -120px, 0 -160px;
  }
  to {
    background-position: 35px 520px, -30px 560px;
  }
}

@keyframes fogDrift {
  from {
    transform: translateX(-18px);
  }
  to {
    transform: translateX(18px);
  }
}

@keyframes stormFlash {
  0%,
  86%,
  100% {
    opacity: 0.48;
  }
  88% {
    opacity: 0.82;
  }
  90% {
    opacity: 0.42;
  }
  92% {
    opacity: 0.72;
  }
}

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

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

@keyframes weatherFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes iconFlash {
  0%,
  86%,
  100% {
    filter: brightness(1);
  }
  88%,
  92% {
    filter: brightness(1.18);
  }
}

@keyframes sunSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes signalPulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(36, 161, 72, 0.12);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(36, 161, 72, 0.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
