:root {
  color-scheme: light;
  --bg-top: #edf5ff;
  --bg-bottom: #d9e8ff;
  --ink: #102748;
  --muted: #4f6d97;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-soft: rgba(255, 255, 255, 0.78);
  --border: rgba(129, 164, 223, 0.52);
  --line: rgba(131, 163, 218, 0.38);
  --accent: #0f73f0;
  --accent-2: #37a8ff;
  --danger: #be2138;
  --shadow: 0 22px 46px rgba(32, 67, 124, 0.18);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Heebo", "Segoe UI", sans-serif;
  direction: rtl;
  background:
    radial-gradient(90rem 45rem at -15% -10%, rgba(95, 175, 255, 0.25), transparent 45%),
    radial-gradient(70rem 45rem at 120% 0%, rgba(85, 139, 255, 0.18), transparent 45%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
  -webkit-tap-highlight-color: rgba(38, 210, 255, 0.24);
}

.app {
  width: min(980px, 100%);
  min-width: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -100px;
  z-index: 200;
  border-radius: 10px;
  padding: 8px 12px;
  background: #dff7ff;
  color: #03122a;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus-visible {
  top: 12px;
  outline: 2px solid #fff;
}

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface), rgba(233, 244, 255, 0.82));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  backdrop-filter: blur(12px);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  pointer-events: none;
}

.card::before {
  width: 220px;
  height: 220px;
  right: -80px;
  top: -80px;
  background: rgba(22, 120, 255, 0.16);
}

.card::after {
  width: 200px;
  height: 200px;
  left: -70px;
  bottom: -100px;
  background: rgba(59, 151, 255, 0.18);
}

.card__header {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.title-wrap {
  display: grid;
  gap: 6px;
}

h1 {
  margin: 0;
  font-family: "Heebo", "Segoe UI", sans-serif;
  font-size: clamp(1.9rem, 4.3vw, 3.3rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  text-wrap: balance;
  scroll-margin-top: 90px;
}

.coverage-text {
  display: block;
  margin: 0;
  font-size: clamp(0.88rem, 1.35vw, 1.06rem);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.refresh-btn {
  border: 1px solid rgba(14, 85, 203, 0.35);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  font-family: "Heebo", "Segoe UI", sans-serif;
  padding: 10px 15px;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 20px rgba(22, 120, 255, 0.26);
}

.refresh-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(22, 120, 255, 0.33);
  filter: saturate(1.08);
}

.refresh-btn:active {
  transform: translateY(0);
}

.refresh-btn__icon {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  line-height: 0;
}

.refresh-btn[aria-busy="true"] .refresh-btn__icon svg {
  animation: spin 0.9s linear infinite;
}

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

.refresh-btn:focus-visible,
.search input:focus-visible {
  outline: 2px solid #0e64ee;
  outline-offset: 2px;
}

.search {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.search label {
  font-weight: 700;
  font-size: 1.05rem;
}

.search input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  min-height: 46px;
  color: #16315b;
  background: var(--surface-soft);
  font: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  text-align: right;
}

.search input::placeholder {
  color: #6f8fbe;
}

.search input:focus {
  border-color: rgba(21, 112, 240, 0.75);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(18, 127, 255, 0.16);
}

.area-suggestions-menu {
  list-style: none;
  margin: 6px 0 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 28px rgba(28, 74, 143, 0.14);
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

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

.area-suggestion-item {
  list-style: none;
}

.area-suggestion-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #16315b;
  font: inherit;
  text-align: right;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.area-suggestion-btn:hover {
  background: rgba(235, 245, 255, 0.95);
}

.area-suggestion-btn.is-active {
  background: rgba(221, 239, 255, 0.98);
}

.area-suggestion-btn:focus-visible {
  outline: 2px solid #0e64ee;
  outline-offset: 2px;
}

.last-searches {
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.last-searches[hidden] {
  display: none;
}

.last-searches__title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.03rem;
  color: #365684;
}

.last-searches__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.clear-searches-btn {
  border: 1px solid rgba(21, 111, 240, 0.22);
  background: rgba(255, 255, 255, 0.7);
  color: #3b5d8f;
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 34px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.clear-searches-btn:hover {
  background: rgba(236, 245, 255, 0.95);
  color: #224d8a;
  border-color: rgba(21, 111, 240, 0.36);
}

.clear-searches-btn:focus-visible {
  outline: 2px solid #0e64ee;
  outline-offset: 2px;
}

.last-searches__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.last-search-chip {
  border: 1px solid rgba(21, 111, 240, 0.25);
  background: rgba(255, 255, 255, 0.8);
  color: #15457d;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.last-search-chip:hover {
  background: rgba(232, 244, 255, 0.95);
  border-color: rgba(21, 111, 240, 0.4);
  transform: translateY(-1px);
}

.last-search-chip:focus-visible {
  outline: 2px solid #0e64ee;
  outline-offset: 2px;
}

.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1.01rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 13px;
  position: relative;
  z-index: 1;
}

.alert-section {
  list-style: none;
  display: grid;
  gap: 8px;
}

.alert-section__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #224d8a;
}

.alert-section__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.alert-item {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.95), rgba(238, 247, 255, 0.9));
  border-radius: 17px;
  padding: 15px 16px;
  display: grid;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  content-visibility: auto;
  contain-intrinsic-size: 0 124px;
}

.alert-item:hover {
  border-color: rgba(56, 139, 245, 0.55);
  transform: translateY(-1px);
}

.alert-item strong {
  font-size: 1.14rem;
  font-family: "Heebo", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.alert-time {
  color: #4e6c98;
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 640px) {
  body {
    padding: 14px;
  }

  .card {
    padding: 18px;
    border-radius: 18px;
  }

  h1 {
    font-size: clamp(1.5rem, 8vw, 2.2rem);
  }

  .coverage-text {
    font-size: 0.88rem;
  }

  .card__header {
    flex-direction: column;
    align-items: stretch;
  }

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