:root {
  --bg-deep: #05010f;
  --bg-mid: #0a0930;
  --bg-blue: #0e1a4f;
  --blue-1: #1d4ed8;
  --blue-2: #2563eb;
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --pink: #ff2d95;
  --pink-bright: #ff5dc8;
  --magenta: #c026d3;
  --text: #e6f0ff;
  --text-dim: #8aa0c8;
  --grid: rgba(255, 45, 149, 0.18);
  --grid-glow: rgba(34, 211, 238, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: ui-sans-serif, -apple-system, "SF Pro Display", "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, #2a0a4a 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, #4a0a3a 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 60%, var(--bg-blue) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 24px calc(96px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

/* synthwave background chart — temp + wind across the day */
.bg-chart {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  background: linear-gradient(155deg, rgba(14, 26, 79, 0.5) 0%, rgba(10, 9, 48, 0.9) 100%);
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 22px;
  padding: 36px 36px 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(255, 45, 149, 0.08) inset,
    0 30px 80px -10px rgba(255, 45, 149, 0.25),
    0 10px 40px -10px rgba(34, 211, 238, 0.2);
}

/* FOUC prevention: spektrum's `data-cloak` directive holds the card hidden until
   `bindDOM()` strips the attribute. The keyframe is a safety net that reveals
   the card even if the JS module fails to load from the CDN. */
.card[data-cloak] {
  opacity: 0;
  animation: card-reveal-fallback 0.3s ease-out 1.5s 1 forwards;
}
.card:not([data-cloak]) {
  opacity: 1;
  transition: opacity 0.25s ease-out;
}
@keyframes card-reveal-fallback {
  to { opacity: 1; }
}

.hero h1 {
  margin: 0;
  font-size: 36px;
  letter-spacing: -0.02em;
  font-weight: 800;
  background: linear-gradient(90deg, var(--cyan-bright) 0%, #fff 40%, var(--pink-bright) 65%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 28px rgba(255, 93, 200, 0.35);
}

.hero h1 .accent {
  color: var(--pink);
  -webkit-text-fill-color: var(--pink);
  text-shadow: 0 0 14px var(--pink);
}

.hero .tag {
  margin: 6px 0 24px;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* card head: title + search side-by-side on desktop, stacked on mobile */
.card-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}

.card-head .hero { flex: 1; min-width: 0; }
.card-head .hero .tag { margin-bottom: 0; }

/* search bar = search form + home button trailing it */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: 360px;
}

/* search */
.search {
  display: flex;
  gap: 10px;
  flex: 1;
  /* Anchor the absolutely-positioned button inside the input on desktop. */
  position: relative;
}

.home-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(5, 1, 15, 0.55);
  border: 1px solid rgba(103, 232, 249, 0.25);
  border-radius: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.06s;
}

.home-btn svg { display: block; }

.home-btn:hover {
  color: var(--cyan-bright);
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

.home-btn:active { transform: translateY(1px); }

.search-input {
  flex: 1;
  /* Right padding leaves room for the absolutely-positioned button inside the input on desktop. */
  padding: 11px 96px 11px 16px;
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
  color: var(--text);
  background: rgba(5, 1, 15, 0.55);
  border: 1px solid rgba(103, 232, 249, 0.25);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--text-dim); }

.search-input:focus {
  border-color: var(--pink);
  box-shadow:
    0 0 0 3px rgba(255, 45, 149, 0.18),
    0 0 22px rgba(255, 45, 149, 0.35);
}

.search-btn {
  /* Sits inside the input field on desktop. The mobile breakpoint flips this back to a regular flex sibling. */
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  padding: 0 18px;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--magenta) 100%);
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  box-shadow:
    0 4px 18px rgba(255, 45, 149, 0.45),
    0 0 0 1px rgba(255, 93, 200, 0.5) inset;
  transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
}

.search-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow:
    0 6px 26px rgba(255, 45, 149, 0.6),
    0 0 0 1px rgba(255, 93, 200, 0.7) inset;
}

.search-btn:active { transform: translateY(1px); }
.search-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* current location */
.location {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 20px 22px;
  margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08) 0%, rgba(255, 45, 149, 0.08) 100%);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 16px;
}

.loc-text h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.loc-text .comma { color: var(--pink); }
.loc-text .country {
  color: var(--cyan-bright);
  font-weight: 500;
}

.loc-text .date {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.loc-temp {
  display: flex;
  align-items: center;
  gap: 12px;
}

.now-temp {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, var(--cyan-bright), var(--pink-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(255, 93, 200, 0.3);
}

.now-icon {
  font-size: 44px;
  filter: drop-shadow(0 0 12px rgba(255, 93, 200, 0.4));
}

/* error */
.error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: rgba(255, 45, 149, 0.12);
  border: 1px solid rgba(255, 45, 149, 0.4);
  border-radius: 10px;
  color: var(--pink-bright);
  font-size: 14px;
}

.error-msg { flex: 1; min-width: 0; }

.retry-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pink-bright);
  background: transparent;
  border: 1px solid rgba(255, 93, 200, 0.6);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.retry-btn:hover:not(:disabled) {
  color: #fff;
  border-color: var(--pink-bright);
  background: rgba(255, 45, 149, 0.18);
}

.retry-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* day tabs (today / tomorrow) */
.day-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.day-tab {
  flex: 1;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(5, 1, 15, 0.55);
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.2s;
}

.day-tab:hover:not(.active) {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

.day-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--magenta) 100%);
  border-color: var(--pink-bright);
  box-shadow:
    0 0 0 1px rgba(255, 93, 200, 0.5) inset,
    0 0 18px rgba(255, 45, 149, 0.55);
}

/* daily summary band */
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.sum-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(5, 1, 15, 0.55);
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: 12px;
  min-width: 0;
}

.sum-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan-bright);
  opacity: 0.85;
}

.sum-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.sum-value.sum-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.3));
}

.sum-sep  { color: var(--text-dim); margin: 0 2px; }
.sum-unit { font-size: 12px; color: var(--text-dim); font-weight: 500; }

.sum-sub {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* two-column AM/PM grid */
.hours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hours-col { min-width: 0; }

.col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.col-head > span:first-child {
  color: var(--pink-bright);
  text-shadow: 0 0 8px rgba(255, 93, 200, 0.4);
}

/* hourly section header + collapse toggle */
.hours-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
}

.hours-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan-bright);
  text-shadow: 0 0 8px rgba(103, 232, 249, 0.4);
}

.hours-toggle {
  background: transparent;
  border: 1px solid rgba(103, 232, 249, 0.22);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.hours-toggle:hover {
  border-color: var(--cyan);
  color: var(--text);
  background: rgba(34, 211, 238, 0.08);
}

/* collapsed preview: current + next 2 hours, three columns */
.hours-preview {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hour-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: rgba(5, 1, 15, 0.5);
  border: 1px solid rgba(103, 232, 249, 0.1);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.hour-card.now {
  background: linear-gradient(135deg, rgba(255, 45, 149, 0.18) 0%, rgba(34, 211, 238, 0.08) 100%);
  border-color: var(--pink);
  box-shadow:
    0 0 0 1px rgba(255, 45, 149, 0.3),
    0 0 22px rgba(255, 45, 149, 0.25);
}

.hc-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--cyan-bright);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.hour-card.now .hc-time {
  color: var(--pink-bright);
  font-weight: 800;
}

.hc-icon {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.3));
}

.hc-temp {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Wind + precip pair: side-by-side on desktop, stacked on mobile so
   neither line gets squeezed in the narrow 3-up preview grid.
   Left-aligned so wind + precip share a common left edge (centered
   alignment makes the two lines look staggered on narrow cards). */
.hc-meta {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  align-self: stretch;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.hc-wind, .hc-precip {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hc-wind   { color: var(--text-dim); }
.hc-precip { color: var(--cyan-bright); }

/* hourly list */
.hours {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.hour {
  display: grid;
  grid-template-columns: 48px 44px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(5, 1, 15, 0.5);
  border: 1px solid rgba(103, 232, 249, 0.1);
  border-radius: 10px;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.hour:hover {
  border-color: rgba(103, 232, 249, 0.3);
  background: rgba(14, 26, 79, 0.6);
  transform: translateX(2px);
}

.hour.past { opacity: 0.45; }

.hour.now {
  background: linear-gradient(90deg, rgba(255, 45, 149, 0.18) 0%, rgba(34, 211, 238, 0.08) 100%);
  border-color: var(--pink);
  box-shadow:
    0 0 0 1px rgba(255, 45, 149, 0.3),
    0 0 22px rgba(255, 45, 149, 0.25);
}

.hour.now .hour-label {
  color: var(--pink-bright);
  font-weight: 800;
}

.hour-label {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--cyan-bright);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.hour-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 30px;
  text-align: center;
  filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.3));
  line-height: 1;
}

.hour-temp {
  grid-column: 3;
  grid-row: 1;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
}

.hour-wind {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hw-precip { color: var(--cyan-bright); }
.hw-wind   { color: var(--text-dim); }

/* radar map */
.weather-map-section { margin-bottom: 24px; }

.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
}

.map-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan-bright);
  text-shadow: 0 0 8px rgba(103, 232, 249, 0.4);
}

.map-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-map-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.weather-map {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  overflow: hidden;
  background: var(--bg-deep);
  box-shadow: 0 0 0 1px rgba(255, 45, 149, 0.08) inset;
  transition: height 0.3s ease;
}

.weather-map.collapsed { height: 90px; }

.radar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(5, 1, 15, 0.55);
  border: 1px solid rgba(103, 232, 249, 0.15);
  border-radius: 10px;
}

.map-btn {
  background: transparent;
  border: 1px solid rgba(103, 232, 249, 0.22);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.map-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.1);
}

.map-btn.map-play {
  min-width: 36px;
  font-size: 13px;
  border-color: var(--pink);
  color: var(--pink-bright);
}

.map-btn.map-play:hover {
  background: rgba(255, 45, 149, 0.15);
}

.map-btn.map-style-toggle {
  padding: 2px 8px;
  font-size: 14px;
  line-height: 1.2;
}

.map-frame {
  /* Auto on both sides: centered in the leftover flex space between the
     playback buttons (left) and the style toggle (right). */
  margin: 0 auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* Precipitation badge: top-right L.Control showing the Open-Meteo precip
   probability for the radar frame's hour, in the searched city's timezone. */
.leaflet-control-precip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(5, 1, 15, 0.78);
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cyan-bright);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.leaflet-control-precip .precip-icon { font-size: 13px; line-height: 1; }
.leaflet-control-precip .precip-value { line-height: 1; }

/* Leaflet UI overrides — pull the default chrome into the synthwave palette */
.leaflet-container {
  background: var(--bg-deep) !important;
  font-family: inherit !important;
}
.leaflet-control-attribution {
  background: rgba(5, 1, 15, 0.75) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
  padding: 2px 6px !important;
}
.leaflet-control-attribution a {
  color: var(--cyan) !important;
}
.leaflet-bar a {
  background: rgba(5, 1, 15, 0.85) !important;
  color: var(--text) !important;
  border-color: rgba(103, 232, 249, 0.22) !important;
}
.leaflet-bar a:hover {
  background: rgba(34, 211, 238, 0.12) !important;
  color: var(--cyan-bright) !important;
}

/* iOS Add-to-Home-Screen hint modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 1, 15, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modal-fade 0.2s ease-out;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(155deg, rgba(14, 26, 79, 0.92) 0%, rgba(10, 9, 48, 0.96) 100%);
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255, 45, 149, 0.15) inset,
    0 30px 80px -10px rgba(255, 45, 149, 0.4),
    0 10px 40px -10px rgba(34, 211, 238, 0.3);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  animation: modal-pop 0.22s ease-out;
}

@keyframes modal-pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.modal-head {
  padding: 22px 24px 12px;
  border-bottom: 1px solid rgba(103, 232, 249, 0.12);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--cyan-bright) 0%, #fff 50%, var(--pink-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-body {
  padding: 18px 24px;
  color: var(--text-dim);
}

.modal-body p { margin: 0 0 12px; }
.modal-body strong { color: var(--text); font-weight: 700; }

.ios-steps {
  margin: 14px 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ios-steps li::marker {
  color: var(--cyan-bright);
  font-weight: 700;
}

.modal-foot-note {
  margin-top: 14px !important;
  font-size: 12px;
  font-style: italic;
  opacity: 0.75;
}

.modal-foot {
  padding: 12px 24px 22px;
  display: flex;
  justify-content: flex-end;
}

.modal-confirm {
  padding: 10px 22px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--pink) 0%, var(--magenta) 100%);
  border: 1px solid rgba(255, 93, 200, 0.5);
  border-radius: 10px;
  cursor: pointer;
  box-shadow:
    0 4px 18px rgba(255, 45, 149, 0.45),
    0 0 0 1px rgba(255, 93, 200, 0.5) inset;
  transition: filter 0.15s, transform 0.06s;
}

.modal-confirm:hover { filter: brightness(1.1); }
.modal-confirm:active { transform: translateY(1px); }

/* time-travel: past searches */
.time-travel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed rgba(103, 232, 249, 0.18);
}

.tt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.tt-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan-bright);
  text-shadow: 0 0 8px rgba(103, 232, 249, 0.4);
}

.tt-hint {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: lowercase;
}

.searches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

.searches:empty::after {
  content: 'no past searches yet';
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.04em;
  align-self: center;
}

.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: rgba(5, 1, 15, 0.55);
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.search-pill:hover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
}

.search-pill.current {
  background: linear-gradient(135deg, var(--pink) 0%, var(--magenta) 100%);
  border-color: var(--pink-bright);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 93, 200, 0.5) inset,
    0 0 18px rgba(255, 45, 149, 0.55);
}

.search-pill.current .pill-cc { color: rgba(255, 255, 255, 0.85); }

.search-pill .pill-cc {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--cyan-bright);
  opacity: 0.85;
}

/* footer */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 10px 24px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  border-top: 1px solid rgba(103, 232, 249, 0.15);
  background: rgba(5, 1, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-footer p {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.site-footer a {
  color: var(--pink-bright);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px dashed rgba(255, 93, 200, 0.4);
  padding-bottom: 1px;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.site-footer a:hover {
  color: var(--cyan-bright);
  border-bottom-color: var(--cyan-bright);
}

.spektrum-mark {
  width: 14px;
  height: 14px;
  display: inline-block;
  flex: 0 0 auto;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-bottom: none;
  padding: 0;
  color: var(--text-dim);
  background: rgba(103, 232, 249, 0.04);
  transition: color 0.12s ease, background 0.12s ease, transform 0.06s ease;
}

.site-footer .social-link:hover {
  color: var(--cyan-bright);
  background: rgba(103, 232, 249, 0.12);
}

.site-footer .social-link:active {
  transform: translateY(1px);
}

.site-footer .social-link svg {
  display: block;
}

/* responsive */
@media (max-width: 560px) {
  body { padding: 32px 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 24px 18px 22px; border-radius: 18px; }
  .hero h1 { font-size: 28px; }
  .now-temp { font-size: 44px; }
  .now-icon { font-size: 34px; }

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

  /* Stack hero above search on mobile, with the search button as a normal flex sibling
     (revert the desktop "button-inside-input" treatment so narrow viewports get a full-width input). */
  /* Home button moves to the top-right corner of the card head on mobile so
     the search input gets full width and the button never clips off-screen. */
  .card-head { flex-direction: column; align-items: stretch; gap: 0; position: relative; padding-right: 50px; }
  .card-head .hero .tag { margin-bottom: 24px; }
  .card-head .search-bar { width: 100%; }
  .card-head .search { width: auto; gap: 8px; position: static; }
  .card-head .home-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
  }
  .search-input { padding: 12px 14px; font-size: 15px; }
  .search-btn {
    position: static;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 12px;
    letter-spacing: 0.04em;
  }

  .summary { grid-template-columns: repeat(2, 1fr); }
  .sum-value { font-size: 18px; }
  .sum-value.sum-icon { font-size: 26px; }

  .hours-head h2 { font-size: 11px; }
  .hours-toggle  { font-size: 10px; padding: 4px 10px; }
  .hour-card     { padding: 12px 8px; }
  .hour-card .hc-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
  .hc-icon       { font-size: 26px; }
  .hc-temp       { font-size: 19px; }

  .hours-grid { grid-template-columns: 1fr; gap: 18px; }

  .weather-map { height: 260px; }
  .weather-map.collapsed { height: 80px; }
  .map-btn { padding: 4px 8px; font-size: 10px; }
  .map-frame { font-size: 10px; }

  .hour {
    grid-template-columns: 44px 40px 1fr;
    column-gap: 10px;
    padding: 9px 11px;
  }
  .hour-icon { font-size: 28px; }
  .hour-temp { font-size: 19px; }

  /* Footer: keep social icons on the left, stack the credit lines on the right. */
  .site-footer .footer-credits {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  .site-footer .credit-sep { display: none; }
}
