/* ─── World Timer — Dark Space Dashboard ─────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0e1a;
  --card-bg: rgba(15, 20, 35, 0.7);
  --card-border: rgba(255, 255, 255, 0.06);
  --gold: #f5a623;
  --white: #e8e9ed;
  --muted: #7a7d8a;
  --green: #2dd4a8;
  --amber: #f5a623;
  --red: #f5637c;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* Remove the grey iOS/Android tap highlight on interactive elements */
a, button, input, select, textarea, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* Anchor-scroll targets get a little breathing room on mobile */
.section[id] { scroll-margin-top: 1rem; }

/* Media queries only hook utility (prevents horizontal overflow from long unbreakable strings) */
.hero-tagline, .section-desc, .card-city-name, .card-country, .news-title,
.holiday-name, .meeting-tl-label, .slider-city-info, .weather-desc {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ─── Background Layers ─────────────────────────────────────────────────── */
#mapCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 80px 80px;
}

.bg-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(245, 166, 35, 0.04) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: overlay;
}

/* ─── Hero Section ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 3rem;
  padding-left: max(3rem, env(safe-area-inset-left));
  padding-right: max(3rem, env(safe-area-inset-right));
  overflow: hidden;
}

.hero-attribution {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-left {
  position: relative;
  z-index: 10;
  max-width: 480px;
  margin-top: auto;
  margin-bottom: auto;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  line-height: 1;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}

.title-world { color: var(--gold); }
.title-timer { color: var(--white); }

.hero-tagline {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-search {
  position: relative;
  max-width: 360px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}

.hero-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}

.hero-search input:focus {
  border-color: rgba(45, 212, 168, 0.3);
}

.hero-search input::placeholder {
  color: rgba(122, 125, 138, 0.6);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(12, 16, 28, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-results.visible { display: block; }

.search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
}

.search-item:hover,
.search-item.selected {
  background: rgba(45, 212, 168, 0.08);
}

.search-flag { font-size: 1.2rem; }

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

.search-city-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
}

.search-city-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.search-tz {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ─── Hero Map Markers (city dots on map) ───────────────────────────────── */
.hero-map-markers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
}

.map-marker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px currentColor;
}

.map-marker-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

/* ─── Hero Floating Cards ───────────────────────────────────────────────── */
.hero-cards {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
}

.hero-card {
  position: absolute;
  width: 160px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  backdrop-filter: blur(12px);
  pointer-events: auto;
  opacity: 0;
  animation: cardFadeIn 0.6s ease forwards;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.hero-card-city {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
}

.hero-card-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-card-time {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Background city dots (non-tracked, subtle) */
.map-marker-bg .map-marker-dot {
  width: 3px;
  height: 3px;
  animation: pulseSlow 4s ease-in-out infinite;
}

@keyframes pulseSlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ─── Hero Bottom CTA ──────────────────────────────────────────────────── */
.hero-bottom {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: auto;
  padding-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 1s;
}

.btn-cta {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--green);
  border-radius: 50px;
  color: var(--green);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-cta:hover {
  background: var(--green);
  color: var(--bg);
}

.hero-url {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Sections (below fold) ─────────────────────────────────────────────── */
.section {
  position: relative;
  z-index: 3;
  padding: 5rem 0;
  background: var(--bg);
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Dashboard Actions (share / snapshot) ─────────────────────────────── */
.dashboard-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  min-height: 38px;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: progress;
}

.btn-ghost .btn-icon { font-size: 0.9rem; }

/* ─── Share feedback toast ──────────────────────────────────────────────── */
.share-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(24px);
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid rgba(45, 212, 168, 0.35);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── AQI badge + Sun/Moon strip (in city cards) ───────────────────────── */
.aqi-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  margin-left: auto;
  border: 1px solid currentColor;
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.card-sun {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.card-sun .sun-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--white);
}

.card-sun .sun-sep { opacity: 0.4; }

/* ─── Dashboard Cards Grid ──────────────────────────────────────────────── */
.city-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: var(--font-serif); font-weight: 400; color: var(--white); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; }

.city-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  transition: transform 0.2s, border-color 0.2s;
  opacity: 0;
  animation: cardFadeIn 0.5s ease forwards;
}

.city-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-city-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-flag { font-size: 1.3rem; }

.card-city-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--white);
}

.card-country {
  font-size: 0.75rem;
  color: var(--muted);
}

.card-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  margin: -4px;
  opacity: 0.5;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.card-remove:hover,
.card-remove:focus-visible { opacity: 1; color: var(--red); outline: none; }

.card-time-section { margin-bottom: 0.75rem; }

.card-time {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.2;
}

.card-meta {
  display: flex;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

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

.status-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.card-details { border-top: 1px solid var(--card-border); padding-top: 0.75rem; }

.card-weather {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.weather-icon { font-size: 1.1rem; }
.weather-temp { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; }
.weather-desc { font-size: 0.8rem; color: var(--muted); }
.weather-feels { font-size: 0.72rem; color: var(--muted); font-family: var(--font-mono); }
.weather-loading { font-size: 0.8rem; color: var(--muted); }

/* Holiday section */
.card-holidays { margin-bottom: 0.75rem; }

.holiday-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.holiday-item:last-child { border-bottom: none; }

.holiday-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.holiday-name {
  font-size: 0.78rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holiday-date {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.holiday-badge {
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.holiday-badge-today {
  background: rgba(45, 212, 168, 0.15);
  color: var(--green);
  animation: holidayPulse 2s ease-in-out infinite;
}

.holiday-badge-soon {
  background: rgba(245, 166, 35, 0.15);
  color: var(--gold);
}

.holiday-badge-upcoming {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

@keyframes holidayPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.card-section-title {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.card-news { margin-bottom: 0.75rem; }

a.news-item,
.news-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s;
}

a.news-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.news-title { font-size: 0.78rem; color: var(--white); flex: 1; }
a.news-item:hover .news-title { color: var(--green); }
.news-src { font-size: 0.68rem; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }

.sports-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.sports-score + .sports-score {
  border-top: 1px solid rgba(255,255,255,0.03);
}

.sports-match { font-size: 0.78rem; font-family: var(--font-mono); }
.sports-status { font-size: 0.65rem; color: var(--green); font-family: var(--font-mono); white-space: nowrap; }

/* ─── Time Slider Panel ────────────────────────────────────────────────── */
.slider-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.slider-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.slider-source {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-source label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.slider-source select {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  min-width: 200px;
}

.slider-source select option { background: #0f1423; }
.slider-source select optgroup { color: var(--muted); }

.slider-time-display {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--white);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.slider-range-wrap {
  margin-bottom: 2rem;
}

.slider-range-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.slider-range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(45, 212, 168, 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.slider-range-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-range-wrap input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(45, 212, 168, 0.4);
  cursor: pointer;
}

.slider-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.slider-range-labels span {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  font-family: var(--font-mono);
}

.slider-results {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.slider-city-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.slider-city-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.slider-city-row + .slider-city-row {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.slider-city-local {
  background: rgba(45, 212, 168, 0.04);
  border: 1px solid rgba(45, 212, 168, 0.1);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.slider-city-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--white);
}

.slider-city-time {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
}

.slider-city-date {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.slider-city-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Sports Score Cards (enhanced) ────────────────────────────────────── */
.sports-score-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.sports-score-card + .sports-score-card {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.sports-score-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sports-score-teams {
  flex: 1;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--white);
}

.sports-score-teams .score-value {
  color: var(--gold);
  font-weight: 500;
}

.sports-score-detail {
  font-size: 0.65rem;
  color: var(--green);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.sports-league-label {
  font-size: 0.65rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.4rem;
  margin-bottom: 0.2rem;
}

.sports-league-label:first-child {
  margin-top: 0;
}

/* ─── Converter Panel ───────────────────────────────────────────────────── */
.converter-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}

.converter-panel h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

.converter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.converter-row label {
  font-size: 0.8rem;
  color: var(--muted);
  width: 50px;
  flex-shrink: 0;
}

.converter-row select,
.converter-row input[type="time"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.converter-row select option { background: #0f1423; }

.converter-arrow {
  text-align: center;
  font-size: 1.2rem;
  color: var(--muted);
  padding: 0.25rem 0;
}

.converted-result {
  margin-top: 1rem;
  text-align: center;
}

.converted-time-display {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--white);
}

.converted-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.converted-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.meeting-slots { min-height: 100px; }

.meeting-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

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

.meeting-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
}

.meeting-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meeting-slot {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem;
  background: rgba(45, 212, 168, 0.04);
  border-radius: 6px;
}

.slot-local {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--green);
  white-space: nowrap;
  min-width: 80px;
}

.slot-cities {
  font-size: 0.75rem;
  color: var(--muted);
}

.meeting-hint, .meeting-no-overlap {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0;
}

/* ─── Meeting Finder Controls ───────────────────────────────────────────── */
.meeting-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.meeting-city-selectors label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  display: block;
}

.meeting-city-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.meeting-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--muted);
  user-select: none;
}

.meeting-pill:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--white);
}

.meeting-pill.active {
  border-color: var(--green);
  background: rgba(45, 212, 168, 0.1);
  color: var(--green);
}

.meeting-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ─── Per-city Work Hours ──────────────────────────────────────────────── */
.meeting-city-hours {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meeting-city-hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  transition: border-color 0.15s;
}

.meeting-city-hours-row:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.meeting-city-hours-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--white);
  min-width: 120px;
}

.meeting-city-hours-flag {
  font-size: 1rem;
}

.meeting-city-hours-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meeting-city-hours-sep {
  font-size: 0.75rem;
  color: var(--muted);
}

.meeting-city-hours-inputs input[type="time"] {
  padding: 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
  width: 110px;
  transition: border-color 0.15s;
}

.meeting-city-hours-inputs input[type="time"]:focus {
  border-color: rgba(45, 212, 168, 0.4);
}

/* ─── Meeting Visual Timeline ───────────────────────────────────────────── */
.meeting-timeline-visual {
  margin-bottom: 1rem;
}

.meeting-timeline-city {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.meeting-tl-label {
  font-size: 0.72rem;
  color: var(--muted);
  width: 80px;
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meeting-tl-bar {
  flex: 1;
  height: 20px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.meeting-tl-work {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  background: rgba(45, 212, 168, 0.25);
  border: 1px solid rgba(45, 212, 168, 0.4);
}

.meeting-tl-overlap {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  background: rgba(45, 212, 168, 0.5);
  border: 1px solid var(--green);
}

.meeting-tl-hours {
  display: flex;
  justify-content: space-between;
  margin-left: calc(80px + 0.5rem);
  margin-bottom: 0.75rem;
}

.meeting-tl-hours span {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.2);
  font-family: var(--font-mono);
}

.meeting-overlap-summary {
  text-align: center;
  padding: 0.75rem;
  background: rgba(45, 212, 168, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(45, 212, 168, 0.15);
  margin-top: 0.75rem;
}

.meeting-overlap-summary strong {
  color: var(--green);
  font-family: var(--font-mono);
}

.meeting-overlap-summary span {
  font-size: 0.8rem;
  color: var(--muted);
}

.card-news-loading {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.3rem 0;
  font-style: italic;
}

/* ─── Features Grid ─────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── Download Section ──────────────────────────────────────────────────── */
.cta-box {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 3rem 2rem;
  backdrop-filter: blur(12px);
}

.cta-box h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.cta-box .section-desc { margin-bottom: 2rem; }

.download-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.btn-download:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

.btn-download.primary {
  border-color: var(--green);
  color: var(--green);
}

.btn-download.primary:hover {
  background: rgba(45, 212, 168, 0.08);
}

.btn-icon { font-size: 1rem; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 3;
  padding: 2rem 0;
  border-top: 1px solid var(--card-border);
  background: var(--bg);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-sig {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.footer-sig a {
  color: var(--white);
  text-decoration: none;
}

.footer-sig a:hover { color: var(--green); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--white); }

/* ─── Scroll Reveal ─────────────────────────────────────────────────────── */
.section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Mobile Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-cards, .hero-map-markers {
    display: none;
  }

  .hero {
    justify-content: center;
    align-items: flex-start;
    min-height: 80vh;
    min-height: 80svh;
  }

  .hero-left { margin: 0; }

  .section {
    padding: 3.5rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .converter-panel {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Bigger hit area on range slider for touch */
  .slider-range-wrap input[type="range"]::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
  }
  .slider-range-wrap input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 1rem 1.25rem 1.5rem;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    min-height: auto;
  }

  .hero-attribution {
    margin-bottom: 1rem;
    font-size: 10px;
  }

  .hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
  }

  .hero-tagline {
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
  }

  .hero-bottom {
    margin-top: 1.5rem;
    gap: 0.75rem 1rem;
    padding-bottom: 0;
  }

  .hero-search { max-width: 100%; }

  .search-results { max-height: 50vh; }

  .section {
    padding: 2.5rem 0;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

  .container {
    padding: 0 1.25rem;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .cta-box {
    padding: 2rem 1.25rem;
  }

  .cta-box h2 { font-size: 1.6rem; }

  .cta-box .section-desc {
    margin-bottom: 1.25rem;
  }

  /* Prevent iOS Safari zoom-on-focus by forcing 16px inputs on mobile */
  .hero-search input,
  .slider-source select,
  .converter-row select,
  .converter-row input[type="time"],
  .meeting-city-hours-inputs input[type="time"] {
    font-size: 16px;
  }

  /* Dashboard cards: tighter padding, smaller clock keeps the card compact */
  .city-card { padding: 1rem; }
  .card-time { font-size: 1.6rem; }
  .card-meta { flex-wrap: wrap; gap: 0.5rem; }

  /* Slider panel */
  .slider-panel { padding: 1.25rem; }

  .slider-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .slider-source {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .slider-source select { min-width: 100%; width: 100%; }

  .slider-time-display { font-size: 1.75rem; }

  .slider-range-labels span:nth-child(even) { display: none; }

  .slider-city-row {
    grid-template-columns: 1fr auto;
    row-gap: 0.15rem;
    column-gap: 0.5rem;
    padding: 0.55rem 0.5rem;
  }

  .slider-city-date { display: none; }
  .slider-city-status {
    grid-row: 1;
    grid-column: 2;
  }
  .slider-city-time {
    grid-row: 2;
    grid-column: 1 / -1;
    font-size: 0.95rem;
  }

  /* Converter panel */
  .converter-panel { padding: 1.25rem; gap: 1.5rem; }
  .converter-row label { width: 44px; font-size: 0.75rem; }
  .converted-time-display { font-size: 1.5rem; }

  /* Meeting finder */
  .meeting-city-hours-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .meeting-city-hours-label { min-width: auto; }

  .meeting-city-hours-inputs input[type="time"] { width: 100%; }
  .meeting-city-hours-inputs { width: 100%; gap: 0.4rem; }

  .meeting-pill {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  .meeting-tl-label {
    width: 56px;
    font-size: 0.65rem;
  }

  .meeting-tl-hours {
    margin-left: calc(56px + 0.5rem);
  }

  /* Show only every 6th hour label to avoid crowding */
  .meeting-tl-hours span:nth-child(odd) { display: none; }

  .city-cards-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-card { padding: 1.25rem; }

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

  .btn-download {
    justify-content: center;
    min-height: 48px;
    font-size: 0.9rem;
  }

  .btn-cta {
    padding: 0.7rem 1.4rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  footer .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Lighten expensive background layers on small screens to save CPU/GPU */
@media (max-width: 640px) {
  .bg-grain { display: none; }
  .bg-glow { opacity: 0.5; }
  .bg-grid { background-size: 56px 56px; }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .map-marker-dot,
  .holiday-badge-today { animation: none !important; }
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
