:root {
  color-scheme: dark;
  --page-padding: clamp(1rem, 3vw, 3rem);
  --content-width: 1440px;
  --card-bg: rgba(17, 31, 48, 0.64);
  --card-bg-strong: rgba(16, 29, 45, 0.78);
  --card-border: rgba(255, 255, 255, 0.14);
  --card-highlight: rgba(255, 255, 255, 0.08);
  --text: #f7fbff;
  --text-soft: rgba(239, 247, 255, 0.74);
  --text-muted: rgba(229, 239, 248, 0.56);
  --accent: #9fd9ff;
  --accent-rgb: 159, 217, 255;
  --success: #8ee7bc;
  --danger: #ffb8b8;
  --shadow: 0 24px 80px rgba(4, 11, 22, 0.28);
  --weather-image: url("./images/day/cloudy.jpg");
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: #101c2a;
  color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.weather-app {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 1.25rem var(--page-padding) 1.5rem;
  background-color: #16283a;
  transition: background-color 600ms var(--ease-out);
}

.weather-app::before,
.weather-app::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

.weather-app::before {
  z-index: -3;
  background-image: var(--weather-image);
  background-position: center;
  background-size: cover;
  filter: saturate(0.78) contrast(1.05);
  transition: opacity 500ms var(--ease-out), filter 500ms var(--ease-out);
}

.weather-app::after {
  z-index: -2;
  background:
    linear-gradient(115deg, rgba(7, 15, 26, 0.88) 0%, rgba(10, 23, 39, 0.66) 45%, rgba(7, 16, 28, 0.84) 100%),
    linear-gradient(180deg, rgba(4, 12, 22, 0.08), rgba(4, 12, 22, 0.74));
}

.weather-app[data-time="night"] {
  --card-bg: rgba(12, 21, 38, 0.72);
  --card-bg-strong: rgba(10, 18, 33, 0.84);
  --accent: #a9c7ff;
  --accent-rgb: 169, 199, 255;
}

.weather-app[data-time="night"]::before {
  filter: saturate(0.72) brightness(0.66) contrast(1.13);
}

.weather-app[data-weather="clear"][data-time="day"] {
  --accent: #ffd289;
  --accent-rgb: 255, 210, 137;
}

.weather-app[data-weather="rain"] {
  --accent: #91cef0;
  --accent-rgb: 145, 206, 240;
}

.weather-app[data-weather="snow"] {
  --accent: #d7edff;
  --accent-rgb: 215, 237, 255;
}

.weather-app[data-weather="storm"] {
  --accent: #c2b6ff;
  --accent-rgb: 194, 182, 255;
}

.atmosphere {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere__glow {
  position: absolute;
  width: min(48rem, 62vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.15);
  filter: blur(120px);
  opacity: 0.65;
  transition: background 700ms ease;
}

.atmosphere__glow--one {
  top: -24rem;
  right: -10rem;
}

.atmosphere__glow--two {
  bottom: -32rem;
  left: -20rem;
  opacity: 0.36;
}

.atmosphere__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.glass-card {
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  background: linear-gradient(145deg, var(--card-highlight), transparent 38%), var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

.topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr minmax(20rem, 37rem) 1fr;
  align-items: center;
  gap: 1.5rem;
  width: min(100%, var(--content-width));
  min-height: 4.25rem;
  margin: 0 auto 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.75rem;
  text-decoration: none;
}

.brand__mark {
  position: relative;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
}

.brand__mark::before,
.brand__mark::after,
.brand__mark span {
  position: absolute;
  display: block;
  width: 1.35rem;
  height: 0.2rem;
  border-radius: 999px;
  background: var(--text);
  content: "";
}

.brand__mark::before {
  transform: translateY(-0.38rem);
}

.brand__mark::after {
  width: 0.82rem;
  transform: translate(0.26rem, 0.38rem);
}

.brand__mark span {
  width: 1.05rem;
  transform: translateX(0.15rem);
}

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

.brand strong {
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 3.5rem;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 1.1rem;
  background: rgba(13, 26, 42, 0.66);
  box-shadow: 0 12px 40px rgba(5, 12, 23, 0.18), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-form:focus-within {
  border-color: rgba(var(--accent-rgb), 0.68);
  background: rgba(13, 26, 42, 0.83);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.13), 0 12px 40px rgba(5, 12, 23, 0.2);
}

.search-form__icon {
  width: 1.12rem;
  height: 1.12rem;
  flex: 0 0 auto;
  color: var(--text-muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.search-form__input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 0.8rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.93rem;
}

.search-form__input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.search-form__input::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.6;
}

.search-form__submit {
  position: relative;
  display: inline-flex;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 0.82rem;
  background: var(--text);
  color: #102035;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.search-form__submit:hover {
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.search-form__submit:active {
  opacity: 0.82;
}

.search-form__submit > svg {
  display: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.button-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(16, 32, 53, 0.28);
  border-top-color: #102035;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.search-form.is-loading .search-form__submit > span:first-child,
.search-form.is-loading .search-form__submit > svg {
  display: none;
}

.search-form.is-loading .button-spinner {
  display: block;
}

.search-form.is-loading .search-form__submit {
  min-width: 5.3rem;
  cursor: wait;
}

.location-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.45rem);
  right: 0;
  left: 0;
  max-height: min(22rem, 55vh);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 1rem;
  background: rgba(13, 26, 42, 0.96);
  box-shadow: 0 18px 48px rgba(5, 12, 23, 0.35), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

.location-suggestion {
  display: block;
  width: 100%;
  padding: 0.78rem 1rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.location-suggestion:last-child {
  border-bottom: 0;
}

.location-suggestion:hover,
.location-suggestion.is-active {
  background: rgba(var(--accent-rgb), 0.14);
}

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

.location-suggestion strong {
  font-size: 0.88rem;
}

.location-suggestion span,
.location-suggestions__message {
  margin-top: 0.16rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.location-suggestions__message {
  margin: 0;
  padding: 0.9rem 1rem;
}

.data-source {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.55rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.data-source span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0.3rem rgba(142, 231, 188, 0.11);
}

.app-status {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: min(100%, var(--content-width));
  margin: 0 auto 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 184, 184, 0.3);
  border-radius: 1rem;
  background: rgba(66, 25, 31, 0.82);
  box-shadow: 0 16px 48px rgba(5, 12, 23, 0.2);
  backdrop-filter: blur(18px);
}

.app-status[hidden] {
  display: none;
}

.app-status > svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  color: var(--danger);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.app-status p {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  margin: 0;
  font-size: 0.82rem;
}

.app-status p span {
  color: var(--text-soft);
}

.app-status button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

.app-status button svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.dashboard {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(19rem, 0.85fr);
  gap: 1.25rem;
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.dashboard > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 0.42rem;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.12rem, 1.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.section-heading--inline {
  align-items: end;
}

.section-heading--inline > p,
.section-heading--light > p {
  margin: 0 0 0.1rem;
  color: var(--text-muted);
  font-size: 0.73rem;
}

.hero-panel {
  display: flex;
  min-height: 31rem;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  background:
    radial-gradient(circle at 90% 2%, rgba(var(--accent-rgb), 0.17), transparent 36%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.09), transparent 42%),
    var(--card-bg-strong);
}

.hero-panel::after {
  position: absolute;
  right: -6rem;
  bottom: -9rem;
  width: 25rem;
  height: 25rem;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 50%;
  box-shadow: inset 0 0 80px rgba(var(--accent-rgb), 0.05);
  content: "";
  pointer-events: none;
}

.hero-panel__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.last-updated {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.hero-panel__location {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.hero-panel__location > svg {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.45rem;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.hero-panel__location h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.4vw, 3.05rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.hero-panel__location p {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  font-size: 0.83rem;
}

.hero-panel__weather {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin: 1.5rem 0 1rem;
}

.temperature-wrap {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.6vw, 2.1rem);
}

.temperature {
  margin: 0;
  font-size: clamp(6.5rem, 12vw, 10.5rem);
  font-weight: 400;
  letter-spacing: -0.095em;
  line-height: 0.78;
}

.temperature sup {
  display: inline-block;
  margin-left: 0.04em;
  font-size: 0.34em;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  vertical-align: top;
}

.condition-summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 10rem;
}

.condition-summary img {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(4, 12, 22, 0.3));
}

.condition-summary p {
  max-width: 11rem;
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.condition-summary span {
  display: block;
  margin-top: 0.32rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.condition-summary strong {
  color: var(--text-soft);
  font-weight: 600;
}

.temperature-range {
  display: grid;
  flex: 0 0 auto;
  gap: 0.55rem;
  min-width: 7.4rem;
  margin-bottom: 0.15rem;
  padding-left: 1.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.temperature-range span {
  display: grid;
  grid-template-columns: 1rem 1fr auto;
  gap: 0.35rem;
}

.temperature-range i {
  color: var(--accent);
  font-style: normal;
}

.temperature-range strong {
  color: var(--text);
  font-weight: 600;
}

.hero-panel__meta {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.hero-panel__meta p {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.hero-panel__meta svg {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.forecast-panel {
  min-height: 31rem;
  padding: 1.5rem;
}

.forecast-panel__location {
  max-width: 8rem;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-forecast {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.35rem;
}

.forecast-day {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) 2.75rem minmax(5rem, 0.8fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 7.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.forecast-day:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.065);
}

.forecast-day--today {
  border-color: rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.08);
}

.forecast-day__date strong,
.forecast-day__date span,
.forecast-day__condition strong,
.forecast-day__condition span {
  display: block;
}

.forecast-day__date strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.forecast-day__date span,
.forecast-day__condition span {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.forecast-day > img {
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
}

.forecast-day__condition strong {
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forecast-day__temps {
  display: flex;
  gap: 0.6rem;
  font-size: 0.78rem;
}

.forecast-day__temps strong {
  font-weight: 600;
}

.forecast-day__temps span {
  color: var(--text-muted);
}

.forecast-skeleton,
.hour-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
}

.forecast-skeleton {
  height: 7.15rem;
}

.forecast-skeleton::after,
.hour-skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.09) 45%, transparent 70%);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.hourly-panel {
  grid-column: 1 / -1;
  padding: 1.5rem;
}

.hourly-scroll {
  display: grid;
  grid-auto-columns: minmax(6.3rem, 1fr);
  grid-auto-flow: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-bottom: 0.35rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  scrollbar-width: thin;
  scroll-snap-type: inline proximity;
}

.hourly-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.5rem;
}

.hour-item {
  display: grid;
  min-height: 9.3rem;
  place-items: center;
  padding: 0.85rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
  scroll-snap-align: start;
}

.hour-item--now {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.11);
}

.hour-item > span {
  color: var(--text-soft);
  font-size: 0.7rem;
}

.hour-item img {
  width: 2.85rem;
  height: 2.85rem;
}

.hour-item strong {
  font-size: 1rem;
  font-weight: 600;
}

.hour-item small {
  color: var(--text-muted);
  font-size: 0.62rem;
}

.hour-skeleton {
  min-height: 9.3rem;
}

.details-panel {
  grid-column: 1 / -1;
  padding: 1rem 0 0;
}

.section-heading--light {
  padding: 0 0.25rem 0.5rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.metric-card {
  display: flex;
  min-height: 8.7rem;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.metric-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background-color: rgba(25, 42, 61, 0.78);
}

.metric-card__icon {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 0.75rem;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.metric-card__icon svg {
  width: 1.13rem;
  height: 1.13rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.metric-card p,
.metric-card strong,
.metric-card div > span {
  display: block;
}

.metric-card p {
  margin: 0 0 0.42rem;
  color: var(--text-soft);
  font-size: 0.7rem;
}

.metric-card strong {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.metric-card div > span {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.62rem;
}

.sun-panel,
.quick-locations,
.tide-panel {
  padding: 1.5rem;
}

.tide-panel {
  grid-column: 1 / -1;
}

.sun-track {
  position: relative;
  height: 8.7rem;
  margin: 1.2rem 1.2rem 0;
  overflow: hidden;
}

.sun-track::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  content: "";
}

.sun-track__arc {
  position: absolute;
  right: 2%;
  bottom: -7rem;
  left: 2%;
  height: 14rem;
  border: 1px dashed rgba(var(--accent-rgb), 0.36);
  border-radius: 50% 50% 0 0;
}

.sun-track__sun {
  position: absolute;
  z-index: 1;
  top: 3.65rem;
  left: 50%;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.18);
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.28);
  color: var(--accent);
  transform: translate(-50%, -50%);
  transition: left 700ms var(--ease-out), top 700ms var(--ease-out);
}

.sun-track__sun svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.astro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.astro-grid > div {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.8rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.035);
}

.astro-grid svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.astro-grid span,
.astro-grid strong {
  display: block;
}

.astro-grid span {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.61rem;
}

.astro-grid strong {
  margin-top: 0.25rem;
  overflow: hidden;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daylight-duration {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.quick-locations__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.quick-location {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.quick-location:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.08);
}

.quick-location[aria-current="true"] {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.11);
}

/* A saved location's card is a container with two controls — the name/
   region itself is the primary "load this weather" button, and a small
   trailing icon-button removes it. Split like this (rather than nesting a
   remove button inside the card's own <button>) because <button> can't
   contain another <button>. */
.quick-location__select {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.quick-location__remove {
  flex: 0 0 auto;
}

.quick-location__select > svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.quick-location span,
.quick-location small {
  display: block;
}

.quick-location span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-location small {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 400;
}

.quick-locations__empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

#tideStationLabel {
  color: var(--text-muted);
  font-size: 0.73rem;
}

.tide-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.tide-summary__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.8rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.035);
}

.tide-summary__item svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.tide-summary__item span {
  display: block;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.61rem;
}

.tide-summary__item strong {
  display: block;
  margin-top: 0.25rem;
  overflow: hidden;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tide-chart-wrap {
  width: 100%;
  max-width: 640px;
  margin-top: 1.25rem;
  overflow: hidden;
}

.tide-chart {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.tide-chart text {
  fill: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
}

.tide-chart .tide-chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tide-chart .tide-chart__fill {
  fill: rgba(var(--accent-rgb), 0.14);
  stroke: none;
}

.tide-chart .tide-chart__point {
  fill: var(--card-bg-strong);
  stroke: var(--accent);
  stroke-width: 2;
}

.tide-caption {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 0.64rem;
}

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, var(--content-width));
  justify-content: flex-end;
  margin: 1.2rem auto 0;
  color: var(--text-muted);
  font-size: 0.64rem;
}

.footer p {
  margin: 0;
}

.footer a {
  text-underline-offset: 0.18em;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.search-form__input:focus-visible {
  outline: 0;
}

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

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: auto minmax(18rem, 1fr);
  }

  .data-source {
    display: none;
  }

  .dashboard {
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.85fr);
  }

  .hero-panel__weather {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.25rem;
  }

  .temperature-range {
    display: flex;
    width: 100%;
    gap: 1.5rem;
    padding: 0;
    border: 0;
  }

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

  .sun-panel,
  .quick-locations {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  :root {
    --page-padding: 1rem;
  }

  .search-form:focus-within {
    z-index: 10;
  }

  .weather-app {
    padding-top: 1rem;
  }

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

  .brand {
    justify-self: start;
  }

  .search-form {
    grid-row: 2;
  }

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

  .hero-panel,
  .forecast-panel,
  .hourly-panel,
  .details-panel,
  .sun-panel,
  .quick-locations {
    grid-column: 1;
  }

  .hero-panel,
  .forecast-panel {
    min-height: auto;
  }

  .hero-panel {
    gap: 1.75rem;
  }

  .hero-panel__weather {
    flex-direction: row;
    align-items: end;
  }

  .temperature-range {
    display: grid;
    width: auto;
  }

  .forecast-day {
    min-height: 6.3rem;
  }

  .forecast-skeleton {
    height: 6.3rem;
  }

  .sun-panel,
  .quick-locations {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .weather-app {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .brand small {
    display: none;
  }

  .search-form__submit {
    width: 2.75rem;
    flex: 0 0 2.75rem;
    padding: 0;
  }

  .search-form__submit > span:first-child {
    display: none;
  }

  .search-form__submit > svg {
    display: block;
  }

  .search-form.is-loading .search-form__submit {
    min-width: 2.75rem;
  }

  .app-status {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .app-status p {
    display: block;
    width: calc(100% - 2.2rem);
  }

  .app-status p span {
    display: block;
    margin-top: 0.2rem;
  }

  .app-status button {
    margin-left: 2.1rem;
  }

  .glass-card {
    border-radius: 1.25rem;
  }

  .hero-panel {
    min-height: 30rem;
    padding: 1.25rem;
  }

  .hero-panel__weather {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.35rem;
  }

  .temperature-wrap {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .temperature {
    font-size: clamp(6.6rem, 33vw, 9rem);
  }

  .condition-summary {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .condition-summary img {
    width: 3.5rem;
    height: 3.5rem;
  }

  .temperature-range {
    display: flex;
    width: 100%;
    gap: 1.5rem;
  }

  .hero-panel__meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .forecast-panel,
  .hourly-panel,
  .sun-panel,
  .quick-locations,
  .tide-panel {
    padding: 1.2rem;
  }

  .hourly-scroll {
    grid-auto-columns: 6.3rem;
    width: 100%;
    max-width: 100%;
  }

  .forecast-day {
    grid-template-columns: minmax(4.4rem, 1fr) 2.5rem minmax(4rem, 0.8fr) auto;
    gap: 0.45rem;
    padding-right: 0.65rem;
    padding-left: 0.65rem;
  }

  .forecast-day__condition span {
    display: none;
  }

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

  .metric-card {
    min-height: 7.6rem;
  }

  .section-heading--light {
    align-items: flex-start;
    flex-direction: column;
  }

  .sun-track {
    margin-right: 0;
    margin-left: 0;
  }

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

  .astro-grid > div:last-child {
    grid-column: 1 / -1;
  }

  .quick-locations__list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .forecast-day {
    grid-template-columns: minmax(4rem, 1fr) 2.4rem auto;
  }

  .forecast-day__condition {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card,
  .search-form,
  .app-status {
    background-color: rgba(14, 27, 44, 0.94);
  }
}

/* Phase 2: Storm Center. These components intentionally inherit the approved
   Phase 1 tokens and card language above. */
.app-nav {
  display: inline-flex;
  justify-self: end;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.9rem;
  background: rgba(13, 26, 42, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-nav__button {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 0.68rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease;
}

.app-nav__button:hover {
  color: var(--text);
}

.app-nav__button.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text);
}

.app-nav__button svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-nav__live {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0.24rem rgba(142, 231, 188, 0.1);
}

.storm-center {
  --severity-critical: #ff7f86;
  --severity-critical-rgb: 255, 127, 134;
  --severity-severe: #ffab72;
  --severity-severe-rgb: 255, 171, 114;
  --severity-elevated: #f3d17b;
  --severity-elevated-rgb: 243, 209, 123;
  --severity-advisory: #9fd9ff;
  --severity-advisory-rgb: 159, 217, 255;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.25rem;
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.storm-center[hidden] {
  display: none;
}

.dashboard[hidden],
[data-view="storm"] #errorMessage,
[data-view="live-earth"] #errorMessage {
  display: none;
}

.storm-hero {
  display: flex;
  min-height: 11rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background:
    radial-gradient(circle at 92% 0%, rgba(var(--accent-rgb), 0.14), transparent 34%),
    linear-gradient(145deg, var(--card-highlight), transparent 42%),
    var(--card-bg-strong);
}

.storm-hero::after {
  position: absolute;
  top: -9rem;
  right: 4rem;
  width: 21rem;
  height: 21rem;
  border: 1px solid rgba(var(--accent-rgb), 0.13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.storm-hero__content {
  position: relative;
  z-index: 1;
  max-width: 44rem;
}

.storm-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.storm-hero__content > p:last-child {
  max-width: 39rem;
  margin: 0.8rem 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.storm-live-status {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem 0.75rem;
  min-width: 15rem;
  padding-left: 1.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.storm-live-status strong,
.storm-live-status > span:last-of-type {
  grid-column: 2;
}

.storm-live-status strong {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.storm-live-status > span:last-of-type {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.live-badge {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  gap: 0.45rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(142, 231, 188, 0.2);
  border-radius: 0.7rem;
  background: rgba(142, 231, 188, 0.08);
  color: var(--success);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.live-badge i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0.22rem rgba(142, 231, 188, 0.1);
}

.icon-button {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.78rem;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.icon-button:hover {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.09);
}

.icon-button[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

.icon-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.storm-live-status .icon-button {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.storm-live-status .icon-button.is-loading svg {
  animation: spin 700ms linear infinite;
}

.storm-filters {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.15rem;
}

.storm-filters__heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 1.25rem;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.storm-filters__heading > span {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 0.75rem;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.storm-filters__heading svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.storm-filters__heading h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.storm-filters__heading .eyebrow {
  margin-bottom: 0.2rem;
  font-size: 0.58rem;
}

.filter-chips {
  display: flex;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.15rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.filter-chip {
  flex-shrink: 0;
  min-height: 2.35rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.filter-chip:hover {
  border-color: rgba(var(--accent-rgb), 0.25);
  color: var(--text-soft);
}

.filter-chip.is-active {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--text);
}

.filter-selects {
  display: flex;
  gap: 0.5rem;
}

.filter-selects label {
  position: relative;
}

.filter-selects label > span {
  position: absolute;
  z-index: -1;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.filter-selects select {
  min-width: 7.2rem;
  height: 2.35rem;
  padding: 0 1.8rem 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.72rem;
  outline: 0;
  background: rgba(14, 27, 44, 0.86);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.66rem;
}

.filter-selects select:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.storm-api-status {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-color: rgba(255, 184, 184, 0.26);
  background-color: rgba(66, 25, 31, 0.76);
}

.storm-api-status[hidden] {
  display: none;
}

.storm-api-status > svg {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  color: var(--danger);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.storm-api-status div {
  flex: 1;
}

.storm-api-status strong,
.storm-api-status p {
  font-size: 0.75rem;
}

.storm-api-status p {
  margin: 0.2rem 0 0;
  color: var(--text-soft);
}

.storm-api-status button,
.storm-empty-state button {
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
}

.storm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(21rem, 0.85fr);
  gap: 1.25rem;
}

.storm-map-panel,
.alert-feed-panel {
  min-width: 0;
  padding: 1.5rem;
}

.storm-map-count,
.alert-result-count {
  color: var(--text-muted);
  font-size: 0.67rem;
}

.storm-map-wrap {
  position: relative;
  height: 39rem;
  margin-top: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(8, 18, 31, 0.72);
}

.storm-map {
  width: 100%;
  height: 100%;
}

.storm-map-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  background: rgba(9, 20, 34, 0.88);
  text-align: center;
  transition: opacity 180ms ease;
}

.storm-map-state[hidden] {
  display: none;
}

.storm-map-state strong {
  margin-top: 0.9rem;
  font-size: 0.8rem;
}

.storm-map-state p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.67rem;
}

.map-loader {
  width: 1.8rem;
  height: 1.8rem;
  border: 2px solid rgba(var(--accent-rgb), 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.severity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-top: 0.9rem;
  color: var(--text-muted);
  font-size: 0.62rem;
}

.severity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.severity-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--severity-advisory);
}

.severity-dot--critical { background: var(--severity-critical); }
.severity-dot--severe { background: var(--severity-severe); }
.severity-dot--elevated { background: var(--severity-elevated); }
.severity-dot--advisory { background: var(--severity-advisory); }

.alert-feed-panel {
  display: flex;
  height: 46.05rem;
  flex-direction: column;
}

.alert-feed {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 0.65rem;
  min-height: 0;
  margin: 1.25rem -0.3rem 0;
  padding: 0 0.3rem 0.4rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.alert-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.alert-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.18rem;
  background: var(--level-color, var(--severity-advisory));
  content: "";
}

.alert-card:hover,
.alert-card.is-selected {
  border-color: rgba(var(--level-rgb, var(--severity-advisory-rgb)), 0.34);
  background: rgba(var(--level-rgb, var(--severity-advisory-rgb)), 0.075);
}

.alert-card--critical { --level-color: var(--severity-critical); --level-rgb: var(--severity-critical-rgb); }
.alert-card--severe { --level-color: var(--severity-severe); --level-rgb: var(--severity-severe-rgb); }
.alert-card--elevated { --level-color: var(--severity-elevated); --level-rgb: var(--severity-elevated-rgb); }
.alert-card--advisory { --level-color: var(--severity-advisory); --level-rgb: var(--severity-advisory-rgb); }

.alert-card__button {
  display: block;
  width: 100%;
  padding: 1rem 1rem 0.95rem 1.15rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.alert-card__topline,
.alert-card__time,
.alert-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 0.5rem;
  border: 1px solid rgba(var(--level-rgb, var(--severity-advisory-rgb)), 0.25);
  border-radius: 999px;
  background: rgba(var(--level-rgb, var(--severity-advisory-rgb)), 0.1);
  color: var(--level-color, var(--severity-advisory));
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.alert-card__time {
  justify-content: flex-end;
  color: var(--text-muted);
  font-size: 0.58rem;
}

.alert-card h3 {
  margin: 0.75rem 0 0;
  font-size: 0.91rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.alert-card__headline {
  display: -webkit-box;
  margin: 0.45rem 0 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.68rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.alert-card__area {
  display: -webkit-box;
  margin: 0.72rem 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.alert-card__footer {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--text-muted);
  font-size: 0.58rem;
}

.alert-card__footer span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
}

.alert-card__footer svg {
  width: 0.82rem;
  height: 0.82rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.alert-card-skeleton {
  position: relative;
  min-height: 10.25rem;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.045);
}

.alert-card-skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.08) 45%, transparent 70%);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.load-more-button {
  width: 100%;
  min-height: 2.8rem;
  margin-top: 0.75rem;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 0.82rem;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.load-more-button:hover {
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.11);
}

.storm-empty-state {
  display: grid;
  flex: 1;
  place-content: center;
  justify-items: center;
  padding: 2rem 1rem;
  text-align: center;
}

.storm-empty-state[hidden] {
  display: none;
}

.storm-empty-state > span {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 1rem;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.storm-empty-state svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.storm-empty-state h3 {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.storm-empty-state p {
  max-width: 17rem;
  margin: 0.45rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.storm-disclaimer {
  margin: 0;
  padding: 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.63rem;
  line-height: 1.5;
}

/* Phase 3 — Radar & Tropical (additive only; reuses existing tokens/components) */

.storm-subview-tabs {
  padding: 0.85rem 1.15rem;
}

.storm-side-panel {
  display: contents;
}

.storm-filters[hidden],
.alert-feed-panel[hidden] {
  display: none;
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-button--prev svg {
  transform: rotate(180deg);
}

.radar-status {
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.radar-playback {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.radar-timeline {
  flex: 1;
  min-width: 0;
  height: 1.6rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.radar-timeline:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.alert-dialog {
  --severity-critical: #ff7f86;
  --severity-critical-rgb: 255, 127, 134;
  --severity-severe: #ffab72;
  --severity-severe-rgb: 255, 171, 114;
  --severity-elevated: #f3d17b;
  --severity-elevated-rgb: 243, 209, 123;
  --severity-advisory: #9fd9ff;
  --severity-advisory-rgb: 159, 217, 255;
  width: min(43rem, calc(100% - 2rem));
  max-height: min(48rem, calc(100vh - 2rem));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  background: rgba(12, 24, 39, 0.96);
  box-shadow: 0 30px 100px rgba(2, 8, 18, 0.58);
  color: var(--text);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.alert-dialog::backdrop {
  background: rgba(3, 10, 19, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.alert-dialog__header,
.alert-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  background: rgba(255, 255, 255, 0.025);
}

.alert-dialog__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.alert-dialog__header > div {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.alert-dialog__header .eyebrow {
  margin: 0;
}

.alert-dialog__body {
  max-height: calc(min(48rem, 100vh - 2rem) - 9.5rem);
  padding: 1.5rem 1.35rem;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.alert-dialog__body h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.alert-dialog__headline {
  margin: 0.75rem 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.alert-dialog__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1.3rem 0;
}

.alert-dialog__meta > div {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
}

.alert-dialog__meta span,
.alert-dialog__meta strong {
  display: block;
}

.alert-dialog__meta span {
  color: var(--text-muted);
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alert-dialog__meta strong {
  margin-top: 0.3rem;
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-dialog__body section {
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.alert-dialog__body section h3 {
  margin: 0;
  color: var(--accent);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.alert-dialog__body section p {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.65;
}

.preserve-lines {
  white-space: pre-line;
}

.alert-dialog__footer {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.alert-dialog__footer p,
.alert-dialog__footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.62rem;
}

.alert-dialog__footer p svg,
.alert-dialog__footer a svg {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.alert-dialog__footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.maplibregl-map {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.maplibregl-ctrl-group {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(14, 27, 44, 0.88) !important;
  box-shadow: 0 8px 24px rgba(4, 11, 22, 0.22) !important;
  overflow: hidden;
}

.maplibregl-ctrl-group button {
  width: 2.5rem !important;
  height: 2.5rem !important;
}

.maplibregl-ctrl-icon {
  filter: invert(1);
  opacity: 0.82;
}

.maplibregl-ctrl-attrib {
  background: rgba(9, 20, 34, 0.76) !important;
  color: var(--text-muted) !important;
  font-size: 0.55rem !important;
}

.maplibregl-ctrl-attrib a {
  color: var(--text-soft) !important;
}

@media (max-width: 1250px) {
  .storm-live-status .icon-button {
    justify-self: end;
  }

  .storm-filters {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .filter-selects {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 1100px) {
  .app-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .app-nav__button {
    flex: 1;
  }

  .storm-layout {
    grid-template-columns: 1fr;
  }

  .storm-map-wrap {
    height: 34rem;
  }

  .alert-feed-panel {
    height: auto;
    min-height: 35rem;
  }

  .alert-feed {
    max-height: 42rem;
  }
}

@media (max-width: 780px) {
  .app-nav {
    grid-row: 3;
  }

  .storm-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .storm-live-status {
    width: 100%;
    padding: 1rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .storm-live-status .icon-button {
    justify-self: end;
  }

  .storm-filters {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .storm-filters__heading {
    padding: 0 0 0.85rem;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .filter-selects {
    grid-column: auto;
    justify-content: stretch;
  }

  .filter-selects label,
  .filter-selects select {
    width: 100%;
  }

  .alert-dialog__meta {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .app-nav__button {
    min-height: 2.75rem;
  }

  .storm-hero,
  .storm-map-panel,
  .alert-feed-panel {
    padding: 1.2rem;
  }

  .storm-live-status {
    grid-template-columns: auto 1fr auto;
    min-width: 0;
  }

  .live-badge {
    padding: 0 0.55rem;
  }

  .filter-chip,
  .filter-selects select {
    min-height: 2.75rem;
  }

  .filter-chip {
    min-width: 2.75rem;
  }

  .storm-center .icon-button,
  .alert-dialog .icon-button {
    width: 2.75rem;
    height: 2.75rem;
  }

  .filter-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .storm-api-status {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .storm-api-status div {
    width: calc(100% - 2.2rem);
  }

  .storm-api-status button {
    margin-left: 2rem;
  }

  .storm-map-wrap {
    height: 25rem;
  }

  .severity-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .alert-feed-panel {
    min-height: 32rem;
  }

  .alert-feed {
    max-height: none;
    overflow-y: visible;
  }

  .alert-card__button {
    min-height: 44px;
  }

  .alert-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 1rem);
    margin: auto 0 0;
    border-radius: 1.35rem 1.35rem 0 0;
  }

  .alert-dialog__body {
    max-height: calc(100vh - 10rem);
  }

  .alert-dialog__footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storm-live-status .icon-button.is-loading svg,
  .map-loader,
  .alert-card-skeleton::after {
    animation: none;
  }
}
