/* ─────────────────────────────────────
   ATMOSPHERA — Design System
   Warm, clean, trustworthy
───────────────────────────────────── */

:root {
  --bg:           #FAF3E7;
  --bg-card:      #FFFFFF;
  --card-bg:      #FAF8F4;
  --bg-subtle:    #D8D4CB;
  --text-primary: #1C1917;
  --text-secondary: #78716C;
  --text-muted:   #A8A29E;
  --accent:       #2C6E8A;
  --accent-light: #EBF4F8;
  --amber:        #D97706;
  --amber-light:  #FEF3C7;
  --green:        #16A34A;
  --green-light:  #DCFCE7;
  --red:          #DC2626;
  --red-light:    #FEE2E2;
  --border:       #E7E3DC;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --radius:       16px;
  --radius-sm:    10px;
  --radius-full:  999px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --transition:   all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* App-like feel: prevent accidental text selection + Chrome "Touch to Search" popup */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Keep inputs and editable fields fully selectable for typing/editing */
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-body); border: none; }

/* Custom clear (X) button for search fields — always visible when text is present */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E0DBD2;
  color: #57534E;
  flex-shrink: 0;
  align-self: center;
  margin-right: 6px;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.search-clear.show,
input[type="search"]:not(:placeholder-shown) ~ .search-clear { display: inline-flex; }
.search-clear:hover { background: #cfc9be; color: #1C1917; }
.search-clear svg { width: 11px; height: 11px; display: block; }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 1.4rem;
  color: var(--accent);
  animation: pulse-slow 3s ease-in-out infinite;
}

@keyframes pulse-slow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.95); }
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ── Buttons ── */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(44, 110, 138, 0.25);
}
.btn-primary:hover {
  background: #235872;
  box-shadow: 0 4px 12px rgba(44, 110, 138, 0.35);
  transform: translateY(-1px);
}


.btn-premium {
  background: linear-gradient(135deg, #D97706, #B45309);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}
.btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4);
}


.hero-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.hero-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hero-pill {
  background: #F2EFE8;
  border: 0.5px solid #D8D4CC;
  color: #4A4540;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
}


.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.875rem;
  letter-spacing: -0.02em;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.975rem;
  margin-bottom: 2rem;
  line-height: 1.7;
  font-weight: 300;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

/* ── Search ── */
.search-bar {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.25rem 0.25rem 1.25rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  margin-bottom: 1rem;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 110, 138, 0.12), var(--shadow-md);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  padding: 0.5rem 0;
}

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

.search-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  background: var(--accent);
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.search-btn:hover {
  background: #235872;
  transform: scale(1.02);
}

/* ── Autocomplete dropdown ── */
.ac-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  z-index: 999;
  overflow: hidden;
}

.ac-item {
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.ac-item:hover {
  background: var(--bg-hover, rgba(44,110,138,0.08));
}

/* ── Quick Cities ── */
.quick-cities {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.quick-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quick-city {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
}

.quick-city:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ── Results ── */
.results { padding: 0 0.5rem 4rem; }
.results-inner { max-width: 960px; margin: 0 auto; }

/* ── City Header ── */
.city-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.city-info {
  display: flex;
  flex-direction: column;
}

.city-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.city-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  line-height: 1.4;
}

.city-sun-info {
  display: contents;
}

.city-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.22rem;
  padding-top: 0.33rem;
}

.city-local-time {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  line-height: 1.2;
}

.city-sun-row {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
  line-height: 1.4;
}

/* ── AQI Card — Redesigned — flush, no halo/cushion ── */
.aqi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 0.875rem;
  border: 1px solid var(--border);
}

.aqi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-bottom: 0.5px solid var(--border);
}

/* Gauge */
.aqi-circle-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  display: none;
}

.aqi-ring {
  width: 90px;
  height: 90px;
  transform: rotate(-210deg);
  display: none;
}

.aqi-circle-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.aqi-number {
  font-size: 48px;
  font-weight: 700;
  color: inherit;
  line-height: 1;
  letter-spacing: -0.03em;
}

.aqi-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  margin-top: 2px;
}

/* Left side */
.aqi-left {
  flex: 1;
  min-width: 0;
}

/* Right side — big number */
.aqi-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.aqi-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #EAF3DE;
  color: #3B6D11;
  margin-bottom: 6px;
}

.aqi-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #639922;
  flex-shrink: 0;
}

.aqi-category {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.2;
}

.aqi-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Inline AQI colour scale */
.aqi-scale-strip {
  display: none;
}

.aqi-scale-bar-wrap {
  position: relative;
  margin-bottom: 10px;
}

.aqi-scale-bar {
  display: flex;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
}

.aqi-scale-bar > div { flex: 1; }

.aqi-scale-needle {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2.5px solid var(--text-primary);
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  left: 6%;
  transition: left 0.7s cubic-bezier(0.4,0,0.2,1);
}

.aqi-scale-lbls {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-muted);
  padding: 0 2px;
  font-weight: 500;
}

/* Four metrics row — no longer used in markup, kept for backward compat */
.aqi-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 0.5px solid var(--border);
}

.aqi-metric {
  padding: 0.6rem 0;
  text-align: center;
  border-right: 0.5px solid var(--border);
}

.aqi-metric:last-child {
  border-right: none;
}

.aqi-metric-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.aqi-metric-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Pollutants mini-grid inside card */
.aqi-pollutants {
  padding: 0.875rem 1.35rem;
  border-top: 0.5px solid var(--border);
}

.aqi-poll-header {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.aqi-poll-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.aqi-poll-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 9px 10px 8px;
  border: 1px solid var(--border);
}

.aqi-poll-formula {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* Reserve room for 2 lines here — on narrow phone widths a longer value
   (e.g. "106.61" or even a shorter "52.75") can push its unit onto a second
   line while another item (e.g. "19.39") stays on one. A single-line value
   row is only ~24px tall, but a wrapped one measures ~40px — reserving just
   24px (as before) left the bar track for the 1-line items ~16px higher
   than the wrapped item's, i.e. visibly "not level". Reserving the full
   2-line height here means every item's box is the same height regardless
   of whether its own value happened to wrap, so all three bar tracks sit
   flush. */
.aqi-poll-value-row {
  min-height: 40px;
  line-height: 1.2;
}

.aqi-poll-val {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.aqi-poll-unit {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 1px;
}

.aqi-poll-bar-track {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 7px;
  overflow: hidden;
}

.aqi-poll-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.eaqi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* ── AQI Scale (old standalone — kept for compat) ── */
.aqi-scale-container {
  display: none !important;
}

/* ─────────────────────────────────────────
   COMPACT UV & HEAT STRESS CARD
   Sits right after the AQI card on the merged
   "Air Quality & UV" tab. Height matches what
   the old EU Index/WHO limits metrics row used
   to take up.
───────────────────────────────────────── */
.uvheat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 0.875rem;
}
.uvheat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.uvheat-col {
  padding: 0.7rem 0.85rem;
  border-right: 0.5px solid var(--border);
}
.uvheat-col:last-child { border-right: none; }
.uvheat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.adult-chip {
  font-size: 8px;
  font-weight: 800;
  color: #6E7C83;
  background: #E9E4D8;
  padding: 1px 5px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.uvheat-val-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.uvheat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}
.uvheat-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.uvheat-tag.uvheat-safe  { background: #DCFCE7; color: #16A34A; }
.uvheat-tag.uvheat-mod   { background: #FDE9C8; color: #B45309; }
.uvheat-tag.uvheat-warn  { background: #FFE0B2; color: #C2410C; }
.uvheat-tag.uvheat-danger{ background: #FEE2E2; color: #B91C1C; }
.uvheat-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

/* ── Alerts ── */
.alerts-container {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--red-light);
  border: 1px solid #FECACA;
  border-left: 4px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #991B1B;
  animation: slide-in 0.3s ease;
}

.alert-icon { font-size: 1rem; flex-shrink: 0; }

.all-clear {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--green-light);
  border: 1px solid #BBF7D0;
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #166534;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section Title ── */
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

/* Unified section header — same for all sections */
.uv-section-header,
.weather-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Health Risk Assessment title — match section-title */
.vuln-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ─────────────────────────────────────────
   HEALTH RISK ASSESSMENT — compact, 3 in a row
   Height matches the compact UV/Heat card above.
───────────────────────────────────────── */
.health-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 0.875rem;
}
.health-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 0.6rem 0.55rem;
}
.health-name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.2;
}
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 5px;
}
.health-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-sentence {
  font-size: 9.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ── Pollutants Grid ── */
/* pollutants grid moved above */

/* Flush spacer — no cushion, no cardbg. Just keeps consistent bottom margin
   between this section and the next, same flat treatment as everything else. */
.section-card {
  margin: 0 0 0.875rem;
}

/* ── Pollutants Grid — v2, compact, 3 per row always, fully flush (no tan backdrop) ── */
.pollutants-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}

.pollutant-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  background: var(--bg-card);
}

/* Compact stat card — name, big %, value, bar. No message copy, no
   Sources/composition drawer — matches the mockup exactly. */
.p-body { padding: 10px 10px 9px; }

/* Reserve room for 2 lines — on narrow phone widths some pollutant names
   ("Fine Particles · PM2.5") wrap to 2 lines while shorter ones ("Ozone ·
   O3") stay on 1, which used to leave the %/bar below at a different height
   per card. Fixing this row's height keeps every card's bar flush. */
.p-name    { font-size: 10px; letter-spacing: 0.03em; font-weight: 600; line-height: 1.35; min-height: 27px; margin-bottom: 7px; }
.p-formula { font-size: 10px; }
.p-name, .p-formula { color: #57534E; }

.p-pct-big { font-size: 20px; font-weight: 800; line-height: 1; }
.p-green .p-pct-big { color: #16A34A; }
.p-amber .p-pct-big { color: #D97706; }
.p-red   .p-pct-big { color: #DC2626; }

.p-val-sub { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.p-bar-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(0,0,0,0.08);
  margin-top: 8px;
  overflow: hidden;
}
.p-bar-fill { height: 100%; }

/* 3 per row on all screen sizes, including mobile — compact card sizing above
   keeps this legible on narrow phones. */
.pollutant-card.p-full { grid-column: 1 / -1; }

.detail-section {
  margin-bottom: 0.5rem;
}

.detail-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

/* ── Premium Teaser ── */
.premium-teaser {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1px solid #FCD34D;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.premium-teaser-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.premium-teaser h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #92400E;
  margin-bottom: 0.25rem;
}

.premium-teaser p {
  font-size: 0.85rem;
  color: #B45309;
  line-height: 1.5;
}


/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--bg-card);
  margin-top: auto;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-qr-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  max-width: 960px;
  margin: 1rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Mobile Responsive ── */
@media (max-width: 640px) {
  .hero { padding: 2rem 0.5rem 1.5rem; }
  .hero-title { font-size: 1.75rem; }
  .hero-feature-pills { gap: 0.35rem; }
  .hero-pill { font-size: 0.7rem; }
  .aqi-top { gap: 1rem; padding: 1rem 1rem; }
  .aqi-circle-wrap { width: 76px; height: 76px; display: none;}
  .aqi-ring { width: 76px; height: 76px; display: none;}
  .aqi-number { font-size: 38px; }
  .aqi-metrics { grid-template-columns: repeat(2, 1fr); }
  .aqi-metric:nth-child(2) { border-right: none; }
  .aqi-metric:nth-child(3) { border-top: 0.5px solid var(--border); }
  .aqi-metric:nth-child(4) { border-top: 0.5px solid var(--border); }
  .aqi-poll-grid { grid-template-columns: repeat(3, 1fr); }
  .city-header { align-items: flex-start; }
  .premium-teaser-inner { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-qr-row { display: none; }
  .header-actions .btn-ghost { display: none; }
  .header-actions #btn-login { display: inline-flex; }
}




/* Hero — less top padding when cities are shown above */
.hero {
  padding: 2.5rem 0.5rem 2rem;
}


/* ── Premium teaser — updated design ── */
.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, #D97706, #B45309);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.premium-compare {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #92400E;
  line-height: 1.5;
}

.plan-free {
  display: inline-block;
  background: #FDE68A;
  color: #92400E;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  margin-right: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-pro {
  display: inline-block;
  background: #D97706;
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  margin-right: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


.install-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

#install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  z-index: 150;
  animation: slide-up 0.3s ease;
}

.install-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.875rem;
}

.install-banner-text strong { color: var(--text-primary); }
.install-banner-text span { color: var(--text-muted); font-size: 0.8rem; }



body {
  overscroll-behavior-y: none;
}


/* ─────────────────────────────────────────
   UV INDEX SECTION
───────────────────────────────────────── */


.uv-source-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.uv-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-top: 0.5rem;
}

.uv-card.uv-high {
  border-color: rgba(255, 152, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.12);
}

.uv-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.uv-icon-value {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.uv-icon {
  font-size: 2rem;
  line-height: 1;
}

.uv-value-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.uv-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.uv-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.uv-level-badge {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.uv-advice {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
  max-width: 180px;
  line-height: 1.4;
}

.uv-bar-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.3rem;
}

.uv-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  min-width: 4px;
}

.uv-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  padding: 0 2px;
}



.vulnerable-section {
  margin: 0.75rem 0 0.875rem;
}

.vuln-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.vuln-aqi-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-light);
  padding: 2px 10px;
  border-radius: 999px;
}

.vuln-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
  background: var(--bg-subtle);   /* #D8D4CB — та же, что у pollutants */
  padding: 10px;
  border-radius: 14px;
}

.vuln-card {
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vuln-card-top { }

.vuln-group-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.vuln-group-sub {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1px;
}

.vuln-card-action {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}

.vuln-card-risk {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.vuln-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vuln-source {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
  font-style: italic;
}

.vuln-disclaimer {
  background: #FEF3C7;
  border: 0.5px solid #FDE68A;
  border-radius: 10px;
  padding: 8px 11px;
  margin-bottom: 10px;
  font-size: 10.5px;
  line-height: 1.4;
  font-weight: 500;
  color: #92400E;
}

/* ── Additional pollutant styles ── */
.limit-badge { font-size: 0.68rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); font-weight: 600; white-space: nowrap; }
.limit-ok   { background: var(--green-light); color: #166634; }
.limit-over { background: var(--red-light);   color: #991B1B; }
.pollutant-detail { display: none; margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.pollutant-detail.open { display: block; animation: slide-in 0.2s ease; }
.p-composition { font-size: 0.72rem; color: var(--text-muted); font-style: italic; margin-bottom: 0.5rem; padding: 6px 8px; background: var(--bg-subtle); border-radius: 6px; }
.detail-section { margin-bottom: 0.5rem; }
.detail-label { font-weight: 600; color: var(--text-primary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.2rem; }

/* ── Weather section ── */
.weather-section-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.1rem; }
.weather-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; margin-top: 0.5rem; }
.weather-main-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--border); }
.weather-temp-block { display: flex; align-items: center; gap: 0.5rem; }
.weather-emoji-icon { font-size: 2.75rem; line-height: 1; flex-shrink: 0; }
.weather-temp-info { display: flex; flex-direction: column; gap: 0.1rem; }
.weather-temp-value { font-size: 2.2rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.weather-unit { font-size: 1.1rem; font-weight: 500; color: var(--text-muted); }
.weather-feels { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.weather-desc-block { text-align: right; flex: 1; }
.weather-desc-text { font-size: 0.92rem; font-weight: 600; color: var(--text-secondary); }
.weather-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem 1rem; }
@media (min-width: 480px) { .weather-stats-grid { grid-template-columns: repeat(3, 1fr); } }
.weather-stat { display: flex; align-items: flex-start; gap: 0.45rem; }
.weather-stat-icon { font-size: 1rem; line-height: 1.4; flex-shrink: 0; }
.weather-stat-body { display: flex; flex-direction: column; gap: 1px; }
.weather-stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; }
.weather-stat-value { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.weather-precip { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--accent); font-weight: 600; }

/* ─────────────────────────────────────────
   WEATHER — THIS WEEK / THIS MONTH
───────────────────────────────────────── */
.week-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.outlook-tag {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 5px;
  margin-bottom: 0.5rem;
}
.outlook-tag-live { background: #DCFCE7; color: #16A34A; }
.outlook-tag-hist { background: #E9E4D8; color: #6E7C83; }

.week-row {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 8px;
}
.day-card {
  flex: 1;
  text-align: center;
  padding: 6px 2px;
  border-radius: 10px;
  min-width: 0;
}
.day-card.today { background: var(--accent-light); }
.day-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.day-icon { font-size: 22px; margin-bottom: 4px; }
.day-hi { font-size: 12.5px; font-weight: 800; color: var(--text-primary); }
.day-lo { font-size: 10.5px; color: var(--text-muted); }

.month-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
}
.month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.month-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.month-avg-block {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.month-avg-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-bottom: 3px;
}
.month-avg-val { font-size: 30px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.month-range { display: flex; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.month-stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.month-stat-val { font-size: 16px; font-weight: 800; margin-top: 2px; }
.month-note {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.45;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── Hero Impact Banner ── */
.hero-impact-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, #EBF4F8, #F0F7EE);
  border: 1px solid rgba(44, 110, 138, 0.2);
  border-radius: 14px;
  text-align: left;
}

.hero-impact-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.hero-impact-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hero-impact-text strong {
  color: var(--accent);
  font-weight: 700;
}

.hero-impact-mission {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ─────────────────────────────────────────
   HEAT STRESS / WBGT SECTION
   (legacy detailed card styles — kept for
   compatibility, no longer rendered on the
   Air Quality & UV tab which now uses the
   compact .uvheat-card above)
───────────────────────────────────────── */
.sun-heat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 0.5rem;
}

.sun-heat-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 1.1rem 6px;
}

.sun-heat-block-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sun-heat-divider {
  height: 0.5px;
  background: var(--border);
}

/* Heat stress bar — filled + faded */
.hs-bar-wrap {
  position: relative;
  margin-bottom: 5px;
}

.hs-bar {
  height: 5px;
  border-radius: 3px;
  display: flex;
  position: relative;   /* добавить */
}

.hs-seg { height: 100%; }

.hs-indicator {
  position: absolute;            /* было: flex-элемент */
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1C1917;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  pointer-events: none;
  transition: left 0.5s ease;
}

/* UV bar inside sun-heat card */
.uv-card-inner {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 1.1rem 1rem;
  margin-top: 0;
}

/* Heat stress card inside sun-heat */
.heat-stress-card-inner {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 1.1rem 1rem;
  margin-top: 0;
  margin-bottom: 0;
}

.heat-stress-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.heat-stress-main { display: none; }
.heat-stress-icon-wrap { display: none; }
.heat-stress-info { display: none; }
.heat-stress-level { display: none; }
.heat-stress-wbgt { display: none; }

.heat-stress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.1rem 1rem;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.heat-stress-left {
  flex: 1;
  min-width: 0;
}

.hs-status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.heat-stress-level-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: inherit;
  text-transform: capitalize;
}

.heat-stress-advice {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

.heat-stress-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.hs-wbgt-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.hs-wbgt-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.heat-stress-scale { display: flex; flex-direction: column; gap: 0; padding: 0.75rem 1.1rem; border-top: 0.5px solid var(--border); }

.heat-stress-scale-bar {
  display: none; /* replaced by .hs-bar-wrap */
}

.hs-bar {
  height: 5px;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
}

.hs-seg { height: 100%; }


.heat-stress-scale-labels {
  position: relative;
  height: 1em;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.heat-stress-scale-labels span {
  position: absolute;
  transform: translateX(-50%);
}
.heat-stress-scale-labels span:first-child { transform: none; }
.heat-stress-scale-labels span:last-child  { transform: translateX(-100%); }

.heat-stress-science {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.hs-science-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-body);
  transition: color 0.2s;
}
.hs-science-toggle:hover { color: var(--text-primary); }

.hs-science-body {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hs-science-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hs-science-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hs-science-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hs-science-emoji { font-size: 1rem; flex-shrink: 0; margin-top: 0.05rem; }

.hs-science-formula {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--bg-subtle, #f0ede6);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.75rem; /* 3. отступ от текста сверху равный отступу снизу */
}

.hs-night-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-subtle, #f0ede6);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--text-muted);
}




/* ─────────────────────────────────────────
   PREMIUM UPSELL LOCK CARDS
   Inline upsell after free feature cards
───────────────────────────────────────── */

.upsell-lock-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1px solid rgba(0,0,0,0.07);
}


/* SVG pattern — full card, fades to right */
.upsell-pattern {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0.11;
  z-index: 1;
  pointer-events: none;
}

.upsell-lock-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  position: relative;
  z-index: 2;
}

.upsell-lock-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  opacity: 0.45;
}

.upsell-lock-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.upsell-lock-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.upsell-lock-text span {
  font-size: 0.7rem;
  line-height: 1.3;
}

.upsell-upgrade-btn {
  width: 100%;
  padding: 0.6rem 1rem;
  background: var(--bg-card, #fff);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-body);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.upsell-upgrade-btn:hover {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

@media (max-width: 480px) {
  .upsell-lock-card  { padding: 0.7rem 0.9rem; }
  .upsell-upgrade-btn { font-size: 0.84rem; padding: 0.55rem 0.9rem; }
}


/* ─────────────────────────────────────────
   FOOTER UPGRADE HOOK
───────────────────────────────────────── */

.footer-upgrade-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.75;
  transition: opacity 0.2s;
  text-align: center;
}

.footer-upgrade-btn:hover {
  opacity: 1;
}

.footer-upgrade-price {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}



/* ─────────────────────────────────────────
   LOGIN MODAL
───────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-card);
  border-radius: 18px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.18s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

/* Tabs */
.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
}

.modal-tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}

.modal-tab.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--text-primary);
}

/* Body */
.modal-body {
  padding: 1.1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.modal-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-input {
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.modal-input:focus { border-color: var(--accent); }

.modal-msg {
  font-size: 0.78rem;
  padding: 0;
  min-height: 0;
}

.modal-msg.error {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.modal-msg.success {
  background: #EFF7F1;
  color: #2A7A45;
  border: 1px solid #C5E0CC;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.modal-submit {
  width: 100%;
  padding: 0.78rem;
  background: var(--text-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.25rem;
}

.modal-submit:hover    { background: #3a3330; }
.modal-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.upsell-combined {
  position: relative;
  overflow: hidden;
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid rgba(44, 110, 138, 0.16);
  border-radius: 18px;
  padding: 22px;
  background:
    radial-gradient(circle at 10% 6%, rgba(44, 110, 138, 0.12), transparent 42%),
    radial-gradient(circle at 94% 100%, rgba(246, 177, 43, 0.18), transparent 46%),
    linear-gradient(160deg, #F8F6F1 0%, #F2EDE3 100%);
  box-shadow: 0 6px 20px rgba(60, 80, 90, 0.10);
}
.upsell-combined-row { display: flex; gap: 20px; align-items: stretch; }
.upsell-combined-main { flex: 1; min-width: 0; }
.upsell-combined-label {
  font-size: 11px;
  font-weight: 600;
  color: #C68A0D;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.upsell-combined-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: #2C6E8A;
  margin-bottom: 16px;
  line-height: 1.25;
}
.upsell-combined-features { display: flex; flex-direction: column; gap: 12px; }
.upsell-combined-feature { display: flex; gap: 10px; align-items: flex-start; }
.upsell-combined-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  margin-top: 1px;
}
.upsell-combined-feature-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #2A3F49;
  margin-bottom: 1px;
  /* Explicit — otherwise body's global line-height:1.6 makes these
     titles noticeably taller/airier than the rest of the card. */
  line-height: 1.3;
}
.upsell-combined-feature-sub {
  font-size: 11.5px;
  color: #6E7C83;
  line-height: 1.4;
}
/* ══════════════════════════════════════════════════════════════
   UPSELL — right-hand preview strip.
   Same slot the old 150px UV strip occupied, kept deliberately
   narrow so the card keeps its original proportions — but rendered
   in the REAL product's visual language (the actual timeline rows,
   verdict badges and stat tiles from the live Vit D, Activity and
   Travel cards), just scaled down. Static example data, labelled
   "Example — Dubai" in the markup so it can't be read as the
   viewer's own city.
   ══════════════════════════════════════════════════════════════ */
.prev-col { width: 208px; flex-shrink: 0; }
.prev-col-note {
  font-size: 8px; color: #A8A29E; text-align: right;
  margin-bottom: 6px; letter-spacing: 0.04em;
}
.prev-block {
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(44,110,138,0.14);
  border-radius: 10px; padding: 8px 9px; margin-bottom: 8px;
}
.prev-block:last-child { margin-bottom: 0; }
.prev-head {
  font-size: 8px; font-weight: 700; color: #8A8472;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 7px;
}

/* Vitamin D — the live half-hour UV timeline rows, scaled down */
.uv-line { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.uv-time { width: 26px; font-size: 8px; color: #78716C; flex-shrink: 0; line-height: 1.3; }
.uv-bar {
  flex: 1; height: 15px; border-radius: 4px; display: flex; align-items: center;
  padding: 0 5px; font-size: 8px; font-weight: 500; line-height: 1;
}
.uv-val {
  width: 17px; text-align: right; font-size: 8px; font-weight: 700;
  color: #44403C; flex-shrink: 0; font-variant-numeric: tabular-nums; line-height: 1.3;
}
.uv-low   { background: #C7E5DC; color: #1F5E4A; }
.uv-vitd  { background: #AEDCA6; color: #2F6B2A; }
.uv-high  { background: #FAE0BC; color: #B45309; }
.uv-vhigh { background: #FAD2D2; color: #C62828; }

/* Activity — one real hour: verdict badges + the 3 stat tiles */
.act-time { font-size: 10.5px; font-weight: 700; color: #1C1917; margin-bottom: 5px; line-height: 1.2; }
.act-badges { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.act-badge {
  font-size: 7.5px; font-weight: 700; padding: 2px 6px; border-radius: 999px;
  display: flex; align-items: center; gap: 3px; line-height: 1.35; align-self: flex-start;
}
.act-badge::before {
  content: ''; width: 3px; height: 3px; border-radius: 50%; flex-shrink: 0;
  background: currentColor; opacity: 0.75;
}
.badge-caution  { background: #FEF3DA; color: #7A4B07; }
.badge-moderate { background: #FEF3DA; color: #7A4B07; }
.act-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.act-stat { background: #F7F0E4; border-radius: 6px; padding: 5px 2px; text-align: center; }
.act-stat-label {
  font-size: 6px; font-weight: 700; color: #A8A29E;
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; line-height: 1.2;
}
.act-stat-value { font-size: 11px; font-weight: 700; color: #2A3F49; line-height: 1; }
.act-stat-zone { font-size: 6px; color: #854F0B; margin-top: 2px; line-height: 1.2; }

/* Travel — the real result: route, big %, risk badge, factor tiles */
.fl-route { font-size: 7.5px; color: #78716C; margin-bottom: 5px; line-height: 1.4; }
.fl-risk { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 5px; }
.fl-pct { font-size: 21px; font-weight: 700; color: #1C1917; line-height: 1; font-variant-numeric: tabular-nums; }
.fl-badge {
  background: #FEF3DA; color: #7A4B07; font-size: 7px; font-weight: 700;
  padding: 3px 6px; border-radius: 999px; line-height: 1.2;
}
.fl-factors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.fl-factor { background: #F7F0E4; border-radius: 6px; padding: 5px 5px; }
.fl-factor-label {
  font-size: 6px; font-weight: 700; color: #A8A29E;
  text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.2;
}
.fl-factor-score { font-size: 10px; font-weight: 700; color: #2A3F49; margin: 1px 0; line-height: 1; }
.fl-factor-note { font-size: 6.5px; color: #9A948A; line-height: 1.3; }

/* Source link inside a feature line */
.upsell-src {
  color: #2C6E8A; text-decoration: none; font-weight: 600;
  border-bottom: 1px solid rgba(44,110,138,0.3);
}
.upsell-src:hover { border-bottom-color: #2C6E8A; text-decoration: none; }
.upsell-combined-btn {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  background: #F6B12B;
  border: none;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  color: #15435A;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s, transform 0.1s;
}
.upsell-combined-btn:hover { background: #FBC846; }
.upsell-combined-btn:active { transform: scale(0.99); }

@media (max-width: 700px) {
  .upsell-combined-row { flex-direction: column; gap: 18px; }
  .prev-col { width: 100%; }
}

/* On phones the card should read like every other card on the page —
   short. The preview strip is supporting evidence for the desktop
   layout, not content: stacked underneath on a narrow screen it more
   than doubles the card's length and pushes the Upgrade button far
   below the fold. Same call as the footer QR block. */
@media (max-width: 640px) {
  .prev-col { display: none; }
  .upsell-combined { padding: 18px 16px; }
}
