/* ============ Friends Weather — clean, dark, minimal ============ */
:root {
  --bg: #0d0f12;
  --bg-elev: #15181d;
  --bg-card: #1a1d23;
  --bg-card-2: #20242b;
  --line: #2a2f37;
  --line-soft: #20242b;
  --text: #f4f5f7;
  --text-2: #c9ccd2;
  --text-3: #8a8f99;
  --text-4: #7295f6;
  --accent: #ffd23a; /* warm sunny yellow */
  --accent-rain: #4aa3ff; /* rain blue */
  --danger: #ff6b6b;
  --shadow:
    0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 40px -12px rgba(0, 0, 0, 0.7);
  --radius: 18px;
  --radius-sm: 10px;
  --line-hover: #3a414c;
  --line-focus: #4a5260;
  --bg-input-focus: #1a1d23;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-feature-settings:
    "ss01" on,
    "tnum" on;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  padding-bottom: 110px;
}

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

::selection {
  background: var(--accent);
  color: #111;
}

/* Skip link — visible on focus only */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #111;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px clamp(20px, 4vw, 48px) 12px;
  max-width: 1600px;
  margin: 0 auto;
  opacity: 0.25;
  transition: opacity 200ms ease;
}
.topbar:hover,
.topbar:focus-within {
  opacity: 1;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 210, 58, 0.12);
}
.brand h1 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.unit-toggle {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.unit-toggle button {
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}
.unit-toggle button.active {
  background: var(--text);
  color: #0d0f12;
}
.unit-toggle button:hover:not(.active) {
  color: var(--text);
}
.unit-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}
.icon-btn:hover {
  color: var(--text);
  transform: rotate(30deg);
  border-color: var(--line-hover);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Add row — fixed bottom bar */
.add-row {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  /* background: var(--bg); */
  /* border-top: 1px solid var(--line); */
  padding: 16px clamp(20px, 4vw, 48px) 16px;
  opacity: 0.5;
  transition: opacity 200ms ease;
}
.add-row:hover,
.add-row:focus-within {
  opacity: 1;
}
.add-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: nowrap;
  width: 100%;
  max-width: calc(1600px - clamp(40px, 8vw, 96px));
  margin: 0 auto;
  justify-content: flex-end;
  position: relative;
}
.add-form .primary-btn {
  flex-shrink: 0;
  order: 2;
}
.search-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition:
    max-width 260ms ease,
    opacity 200ms ease;
}
.add-form.open .search-wrap {
  max-width: 637px;
  opacity: 1;
}
.search-wrap .search-ico {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
#searchInput {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px 16px 14px 42px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition:
    border-color 180ms ease,
    background-color 180ms ease;
}
#searchInput:focus {
  border-color: var(--line-focus);
  background: var(--bg-input-focus);
}
#searchInput::placeholder {
  color: var(--text-3);
}

.suggest-list {
  position: absolute;
  bottom: calc(100% + 6px);
  top: auto;
  /* left: 0; */
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 30;
  max-height: 260px;
  overflow-y: auto;
  display: none;
  max-width: 640px;
  min-width: 740px;
}
.suggest-list.show {
  display: block;
}
.suggest-list li {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-2);
  transition:
    background-color 140ms ease,
    color 140ms ease;
}
.suggest-list li:hover,
.suggest-list li.active {
  background: var(--bg-card-2);
  color: var(--text);
}
.suggest-list li small {
  color: var(--text-3);
  display: block;
  font-size: 0.72rem;
  margin-top: 2px;
}

.primary-btn {
  background: var(--text);
  color: #0d0f12;
  border: 0;
  padding: 0 22px;
  height: 48px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition:
    transform 140ms ease,
    background-color 160ms ease;
}
.primary-btn:hover {
  transform: translateY(-1px);
}
.primary-btn:active {
  transform: translateY(0);
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.primary-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-3);
  border-radius: 10px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    color 140ms ease,
    border-color 140ms ease;
}
.ghost-btn:hover {
  color: var(--text);
  border-color: var(--line-focus);
}
.ghost-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hint {
  color: var(--text-3);
  font-size: 0.78rem;
  margin: 8px 0 0;
  text-align: center;
  display: none;
}

/* Grid — always max 2 columns; odd counts > 1 get a featured full-width first card */
.grid {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) 60px;
  display: grid;
  gap: 22px;
}
.grid-empty {
  display: block;
}
.grid.cols-1 {
  grid-template-columns: 1fr;
}
.grid.cols-2,
.grid.cols-3,
.grid.cols-4,
.grid.cols-5,
.grid.cols-6,
.grid.cols-7,
.grid.cols-8,
.grid.cols-9,
.grid.cols-10 {
  grid-template-columns: repeat(2, 1fr);
}
/* Featured first card spans both columns for odd counts (>1) */
.grid.cols-3 > .card:first-child,
.grid.cols-5 > .card:first-child,
.grid.cols-7 > .card:first-child,
.grid.cols-9 > .card:first-child {
  grid-column: 1 / -1;
}
@media (max-width: 880px) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .grid.cols-5,
  .grid.cols-6,
  .grid.cols-7,
  .grid.cols-8,
  .grid.cols-9,
  .grid.cols-10 {
    grid-template-columns: 1fr;
  }
  .grid.cols-3 > .card:first-child,
  .grid.cols-5 > .card:first-child,
  .grid.cols-7 > .card:first-child,
  .grid.cols-9 > .card:first-child {
    grid-column: auto;
  }
}

/* Card */
.card {
  background: var(--bg-card);
  /* border: 1px solid var(--line-soft); */
  border-radius: var(--radius);
  padding: 22px 22px 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  animation: cardIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition:
    opacity 200ms ease,
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
  opacity: 0.9;
}
.card:hover {
  opacity: 1;
}
.card[draggable="true"] {
  cursor: grab;
}
.card[draggable="true"]:active {
  cursor: grabbing;
}
.card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}
.card.drag-over {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(255, 210, 58, 0.4),
    var(--shadow);
}
/* dragging children must not capture pointer events */
.card.dragging * {
  pointer-events: none;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.cond {
  font-size: 1.65rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.loc {
  color: var(--text-4);
  margin: 4px 0 0;
  font-size: 0.86rem;
}
.card-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 200ms ease;
}
.card:hover .card-actions,
.card:focus-within .card-actions {
  opacity: 1;
}
/* Touch devices have no hover — always show actions */
@media (hover: none) {
  .card-actions {
    opacity: 1;
  }
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.day-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Hourly row — all cells share the same column layout; Now is just bigger */
.hourly-row {
  display: grid;
  grid-template-columns: minmax(64px, 1.1fr) repeat(7, minmax(54px, 1fr));
  gap: 0;
  align-items: stretch;
  padding: 9px 0;
}
.hourly-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4px;
  gap: 6px;
}
.hourly-cell .h-time {
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.hourly-cell.first .h-time {
  color: var(--text);
  font-weight: 700;
}
.hourly-cell .h-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hourly-cell.first .h-icon {
  width: 50px;
  height: 50px;
}
.hourly-cell .h-pop {
  color: var(--accent-rain);
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 14px;
}
.hourly-cell .h-pop svg {
  width: 9px;
  height: 9px;
}
.hourly-cell.first .h-pop:empty {
  display: none;
}
.hourly-cell .h-temp {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.hourly-cell.first .h-temp {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.card.featured .hourly-cell.first .h-temp {
  font-size: 2.4rem;
}
.card.featured .hourly-cell.first .h-icon {
  width: 60px;
  height: 60px;
}

/* Meta */
.meta-line {
  color: var(--text-2);
  font-size: 0.84rem;
  padding: 18px 0;
  /* border-top: 1px solid var(--line-soft); */
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.meta-line span b {
  font-weight: 600;
  color: var(--text);
}

/* Sunrise/sunset row */
.sun-row {
  display: flex;
  gap: 18px;
  padding: 0 0 16px;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.sun-row[hidden] {
  display: none;
}
.sun-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sun-item svg {
  color: var(--accent);
  flex-shrink: 0;
}
.sun-label {
  color: var(--text-3);
  font-weight: 500;
}
.sun-value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Moon row */
.moon-row {
  display: flex;
  gap: 18px;
  padding: 0 0 16px;
  color: var(--text-2);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.moon-row[hidden] {
  display: none;
}
.moon-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.moon-item svg {
  color: var(--text-3);
  flex-shrink: 0;
}
.moon-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.moon-icon svg {
  width: 20px;
  height: 20px;
}
.moon-label {
  color: var(--text-3);
  font-weight: 500;
}
.moon-value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Narrative */
.narrative {
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 9px 0;
}

/* Days row */
.days-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  /* border-top: 1px solid var(--line-soft); */
  margin: 0 -22px;
}
.day-cell {
  padding: 14px 6px 16px;
  text-align: center;
  cursor: pointer;
  border-right: 1px solid var(--line-soft);
  transition: background-color 160ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.day-cell:last-child {
  border-right: 0;
}
.day-cell:hover {
  background: var(--bg-card-2);
}
.day-cell.active {
  background: var(--bg-card-2);
  box-shadow: inset 0 2px 0 var(--accent);
}
.day-cell .d-name {
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 600;
}
.day-cell .d-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-cell .d-pop {
  color: var(--accent-rain);
  font-size: 0.66rem;
  font-weight: 600;
  min-height: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.day-cell .d-pop svg {
  width: 8px;
  height: 8px;
}
.day-cell .d-temps {
  font-size: 0.78rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.day-cell .d-temps b {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 600px) {
  /* Card chrome — tighter on mobile */
  .grid {
    gap: 16px;
    padding: 0 14px 40px;
  }
  .card {
    padding: 18px 0 0 16px;
    border-radius: 16px;
  }
  .card-head {
    margin-bottom: 10px;
  }
  .cond {
    font-size: 1.5rem;
  }
  .meta-line {
    font-size: 0.82rem;
    gap: 14px;
    padding: 12px 0 14px;
  }
  .sun-row {
    font-size: 0.8rem;
    gap: 14px;
    padding: 0 0 12px;
  }
  .moon-row {
    font-size: 0.8rem;
    gap: 14px;
    padding: 0 0 12px;
  }
  .narrative {
    font-size: 0.78rem;
    padding: 0 12px 12px 0;
  }
  /* Days row — horizontal scroll with snap, 4 days visible */
  .days-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin: 0 -16px;
  }
  .days-row::-webkit-scrollbar {
    display: none;
  }
  .day-cell {
    flex-shrink: 0;
    scroll-snap-align: start;
    min-width: 25%;
    padding: 12px 4px 14px;
    border-right: 1px solid var(--line-soft);
  }
  .day-cell:last-child {
    border-right: 0;
  }

  /* Hourly row — horizontal scroll with snap, all 8 cells reachable */
  .hourly-row {
    background: var(--bg-card-2);
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding: 9px 0;
    gap: 4px;
    margin-bottom: 14px;
    border-radius: var(--radius) 0 0 var(--radius);
  }
  .hourly-row::-webkit-scrollbar {
    display: none;
  }
  .hourly-cell {
    flex-shrink: 0;
    scroll-snap-align: start;
    gap: 6px;
    padding: 0 12px;
    min-width: 52px;
  }
  .hourly-cell.first {
    min-width: 64px;
  }
  .hourly-cell .h-icon {
    width: 32px;
    height: 32px;
  }
  .hourly-cell.first .h-icon {
    width: 44px;
    height: 44px;
  }
  .hourly-cell .h-temp {
    font-size: 1rem;
  }
  .hourly-cell.first .h-temp {
    font-size: 1.7rem;
  }

  /* Bottom bar: keep input + button on one line */
  .add-row {
    padding: 10px 14px 14px;
  }
  .add-form {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .search-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }
  #searchInput {
    padding: 12px 14px 12px 38px;
    font-size: 0.9rem;
    border-radius: 12px;
  }
  .search-wrap .search-ico {
    left: 12px;
  }
  .add-form .primary-btn {
    padding: 0 16px;
    height: 44px;
    font-size: 0.85rem;
    flex-shrink: 0;
    border-radius: 12px;
  }
  .hint {
    display: none;
  }
  body {
    padding-bottom: 78px;
  }
  .topbar {
    padding: 14px 16px 8px;
  }
}

/* Empty state */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-3);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin: 0 clamp(20px, 4vw, 48px);
}
.empty h2 {
  color: var(--text);
  font-weight: 600;
  margin: 0 0 6px;
  font-size: 1.2rem;
}
.empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* Loading skeleton */
.card.loading .cond {
  color: transparent;
  background: var(--line-soft);
  border-radius: 6px;
  height: 1.65rem;
  width: 60%;
}
.card.loading .loc {
  color: transparent;
  background: var(--line-soft);
  border-radius: 4px;
  height: 0.86rem;
  width: 40%;
  margin-top: 8px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 180ms ease;
}
.modal[hidden] {
  display: none !important;
}
.toast[hidden] {
  display: none !important;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  padding: 24px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.field {
  margin-bottom: 18px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 480px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .suggest-list {
    min-width: 100%;
    max-width: calc(100vw - 28px);
    bottom: calc(100% + 6px);
    top: auto;
  }
  input,
  select,
  #searchInput {
    font-size: 16px;
  }
  body {
    overflow-x: hidden;
  }
}
.field label,
.field .field-title {
  display: block;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field .switch-row {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.field select,
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 140ms ease;
}
.field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  cursor: pointer;
}
.field select::-ms-expand {
  display: none;
}
.field select:focus,
.field input:focus {
  border-color: var(--line-focus);
}
.unit-toggle.inline {
  display: inline-flex;
}
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.field-label {
  color: var(--text-2);
  font-size: 0.92rem;
}
.micro {
  font-size: 0.74rem;
  color: var(--text-3);
  margin: 6px 0 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  opacity: 0;
  transition:
    opacity 200ms ease,
    transform 200ms ease;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  border-color: var(--danger);
}

/* ============ Weather icon animations ============ */
@keyframes sunPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
@keyframes sunGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 3px rgba(255, 210, 58, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(255, 210, 58, 0.5));
  }
}
@keyframes cloudDrift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(3px);
  }
}
@keyframes rainDrop {
  0% {
    transform: translateY(-2px);
    opacity: 0.7;
  }
  50% {
    transform: translateY(2px);
    opacity: 1;
  }
  100% {
    transform: translateY(-2px);
    opacity: 0.7;
  }
}
@keyframes snowFall {
  0% {
    transform: translateY(-2px) translateX(0);
  }
  50% {
    transform: translateY(2px) translateX(2px);
  }
  100% {
    transform: translateY(-2px) translateX(0);
  }
}
@keyframes lightningFlash {
  0%,
  90%,
  100% {
    opacity: 1;
  }
  92% {
    opacity: 0.3;
  }
  94% {
    opacity: 1;
  }
  96% {
    opacity: 0.4;
  }
  98% {
    opacity: 1;
  }
}
@keyframes fogWave {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.h-icon[data-icon="sun"] svg,
.d-icon[data-icon="sun"] svg {
  animation:
    sunPulse 6s ease-in-out infinite,
    sunGlow 6s ease-in-out infinite;
}
.h-icon[data-icon="moon"] svg,
.d-icon[data-icon="moon"] svg {
  animation: sunPulse 8s ease-in-out infinite;
}
.h-icon[data-icon="cloudy"] svg,
.d-icon[data-icon="cloudy"] svg {
  animation: cloudDrift 12s ease-in-out infinite;
}
.h-icon[data-icon="partly"] svg,
.d-icon[data-icon="partly"] svg {
  animation: cloudDrift 14s ease-in-out infinite;
}
.h-icon[data-icon="partly-night"] svg,
.d-icon[data-icon="partly-night"] svg {
  animation: cloudDrift 14s ease-in-out infinite;
}
.h-icon[data-icon="rain"] svg,
.d-icon[data-icon="rain"] svg {
  animation: rainDrop 2s ease-in-out infinite;
}
.h-icon[data-icon="snow"] svg,
.d-icon[data-icon="snow"] svg {
  animation: snowFall 3s ease-in-out infinite;
}
.h-icon[data-icon="storm"] svg,
.d-icon[data-icon="storm"] svg {
  animation: lightningFlash 4s steps(1) infinite;
}
.h-icon[data-icon="fog"] svg,
.d-icon[data-icon="fog"] svg {
  animation: fogWave 4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
    transition: none;
  }
  .h-icon svg,
  .d-icon svg {
    animation: none !important;
  }
}
