.weather-alerts {
  display: inline-flex;
}

.weather-alerts[hidden] {
  display: none;
}

.weather-alert-menu {
  --alert-color: #a66d27;
  position: static;
}

.weather-alert-menu[data-color="blue"],
.weather-alert-card[data-color="blue"] { --alert-color: #287da0; }

.weather-alert-menu[data-color="yellow"],
.weather-alert-card[data-color="yellow"] { --alert-color: #c79521; }

.weather-alert-menu[data-color="amber"],
.weather-alert-card[data-color="amber"] { --alert-color: #c47a1b; }

.weather-alert-menu[data-color="orange"],
.weather-alert-card[data-color="orange"] { --alert-color: #d7652a; }

.weather-alert-menu[data-color="red"],
.weather-alert-card[data-color="red"] { --alert-color: #b8392f; }

.weather-alert-menu[data-color="purple"],
.weather-alert-card[data-color="purple"] { --alert-color: #754d93; }

.weather-alert-menu[data-color="black"],
.weather-alert-card[data-color="black"] { --alert-color: #26323a; }

.weather-alert-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--alert-color), transparent 52%);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--alert-color), var(--paper) 91%);
  cursor: pointer;
  list-style: none;
}

.weather-alert-chip::-webkit-details-marker {
  display: none;
}

.weather-alert-chip:focus-visible {
  outline: 2px solid var(--alert-color);
  outline-offset: 3px;
}

.weather-alert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--alert-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--alert-color), transparent 80%);
}

.weather-alert-chip strong {
  font-size: 11px;
  line-height: 1;
}

.weather-alert-chevron {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1;
  transition: transform 160ms ease;
}

.weather-alert-menu[open] .weather-alert-chevron {
  transform: rotate(90deg);
}

.weather-alert-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  left: 50%;
  width: min(430px, calc(100vw - 44px));
  max-height: min(520px, 65vh);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(21, 51, 73, 0.24);
  transform: translateX(-50%);
}

.weather-alert-header {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.weather-alert-list {
  display: grid;
  gap: 10px;
}

.weather-alert-card {
  --alert-color: #a66d27;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--alert-color), transparent 62%);
  border-left: 4px solid var(--alert-color);
  border-radius: 12px;
  background: color-mix(in srgb, var(--alert-color), var(--paper) 94%);
}

.weather-alert-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weather-alert-heading strong {
  font-size: 13px;
  line-height: 1.5;
}

.weather-alert-heading small,
.weather-alert-attribution {
  color: var(--ink-soft);
  font-size: 10px;
}

.weather-alert-body {
  margin-top: 10px;
}

.weather-alert-copy {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-line;
}

.weather-alert-copy:last-child {
  margin-bottom: 0;
}

.weather-alert-copy strong {
  font-weight: 700;
}

.weather-alert-attribution {
  margin: 10px 0 0;
  line-height: 1.6;
}

.weather-alert-attribution a {
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .weather-alert-chip {
    min-height: 29px;
    padding: 5px 8px;
  }

  .weather-alert-chip strong {
    font-size: 10px;
  }

  .weather-alert-popover {
    top: calc(100% + 8px);
    max-height: 58vh;
    padding: 13px;
  }
}
