/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: oklch(0.965 0.005 78);
  --bg-card: oklch(1.0 0 0);
  --bg-chrome: oklch(1.0 0 0);
  --text: oklch(0.22 0 0);
  --text-secondary: oklch(0.53 0 0);
  --text-muted: oklch(0.69 0 0);
  --accent: oklch(0.62 0.16 37);
  --accent-light: oklch(0.91 0.023 41);
  --blue: oklch(0.53 0.16 259);
  --blue-light: oklch(0.94 0.022 257);
  --green: oklch(0.57 0.13 150);
  --green-light: oklch(0.94 0.024 155);
  --border: oklch(0.91 0.006 75);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.06);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 72px;
  --header-height: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.22, 1.2, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark {
  --bg: oklch(0.16 0 0);
  --bg-card: oklch(0.22 0 0);
  --bg-chrome: oklch(0.19 0 0);
  --text: oklch(0.95 0 0);
  --text-secondary: oklch(0.80 0 0);
  --text-muted: oklch(0.65 0 0);
  --accent: oklch(0.78 0.18 37);
  --accent-light: oklch(0.25 0.04 37);
  --blue: oklch(0.78 0.15 259);
  --blue-light: oklch(0.25 0.04 259);
  --green: oklch(0.80 0.18 150);
  --green-light: oklch(0.25 0.04 150);
  --border: oklch(0.35 0 0);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.4);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.5);
}

/* Dark mode timeline adjustments */
html.dark .tl-icon {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary);
}

html.dark .tl-icon .material-symbols-outlined {
  color: var(--text-secondary);
}

html.dark .drive-badge {
  background: var(--bg) !important;
  color: var(--text-secondary) !important;
}

html.dark .activity-icon {
  background: var(--bg) !important;
  color: var(--text-secondary);
}

html.dark .tl-photo-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 55%) !important;
}

html.dark .today-hero-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 60%) !important;
}

html, body { overflow-x: hidden; width: 100%; }
html { font-family: var(--font); font-size: 16px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }

/* Material Symbols base sizing */
.material-symbols-outlined { font-size: inherit; vertical-align: middle; line-height: 1; }
body { min-height: 100dvh; padding-top: var(--header-height); padding-bottom: var(--nav-height); }

/* ===== Header ===== */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-height); background: var(--bg-chrome); border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.header-inner { width: 100%; max-width: 600px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.logo-year { color: var(--tab-primary, var(--accent)); transition: color 0.3s; }
.header-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-icon-btn { color: var(--text-muted); display: flex; align-items: center; padding: 4px; border-radius: 6px; transition: color 0.2s; -webkit-tap-highlight-color: transparent; text-decoration: none; }
.header-icon-btn:hover { color: var(--text); }
.header-icon-btn.music-active { color: oklch(0.58 0.18 145); }
html.dark .header-icon-btn.music-active { color: oklch(0.80 0.18 145); }
.trip-badge { font-size: 1.1rem; letter-spacing: 1px; overflow: hidden; flex-shrink: 1; min-width: 0; }

.header-flag {
  display: inline-block;
  transition: filter 0.5s, opacity 0.5s;
}

.header-flag.visited {
  filter: grayscale(1);
  opacity: 0.4;
}

/* ===== Bottom Nav ===== */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; height: var(--nav-height); background: var(--bg-chrome); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom, 8px); overflow: hidden; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--text-muted); font-size: 0.55rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; transition: color 0.2s; padding: 6px 2px; min-width: 0; -webkit-tap-highlight-color: transparent; }
.nav-item.active { color: var(--tab-primary, var(--accent)); }
.nav-item:active .nav-icon { transform: scale(0.85); transition: transform 0.2s var(--spring); }
.nav-icon { transition: transform 0.3s var(--spring); }
.nav-icon { width: 22px; height: 22px; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Main & View ===== */
.main { max-width: 600px; margin: 0 auto; padding: 16px; overflow-x: hidden; }
.view-header { margin-bottom: 20px; }
.view-title { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.03em; }
.view-subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-top: 3px; }


/* ============================================================
   UNIFIED TIMELINE
   ============================================================ */

/* Container */
.tl { display: flex; flex-direction: column; gap: 0; }

/* Day group: left date column + right events */
.tl-group {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0;
  position: relative;
  padding-bottom: 8px;
}

/* Vertical track line between events */
.tl-group::before {
  content: "";
  position: absolute;
  left: 47px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.tl-group:last-child::before { bottom: 50%; }

/* Separator between day groups */
.tl-group + .tl-group {
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Today highlight strip */
.tl-group.tl-today {
  background: rgba(211, 93, 58, 0.04);
  border-radius: var(--radius);
  margin: 4px 0;
  padding-left: 8px;
  padding-right: 8px;
}

.tl-group.tl-today::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c-primary, var(--accent));
  border-radius: 2px;
}

/* ===== Date column (left) ===== */
.tl-date {
  padding: 14px 0 8px;
  text-align: center;
  position: sticky;
  top: calc(var(--header-height) + 12px);
  align-self: start;
}

.tl-date-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-primary, var(--accent));
  line-height: 1;
}

.tl-date-text {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.tl-date-flag {
  font-size: 0.9rem;
  margin-top: 3px;
}

/* ===== Events column (right) ===== */
.tl-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 20px;
}

/* ===== Single event row ===== */
.tl-evt {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0;
  position: relative;
}

/* Icon on the track */
.tl-track {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  position: relative;
  z-index: 2;
}

.tl-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.tl-icon .material-symbols-outlined { font-size: 14px; }
.tl-icon.drive { border-color: var(--c-primary, var(--blue)); background: var(--c-light, var(--blue-light)); }
.tl-icon.visit { border-color: var(--c-primary, var(--green)); background: var(--c-light, var(--green-light)); }
.tl-icon.hotel { border-color: var(--c-primary, var(--accent)); background: var(--c-light, var(--accent-light)); }
.tl-icon.car { border-color: #F59E0B; background: var(--accent-light); }
.tl-icon.flight { border-color: var(--blue); background: var(--blue-light); }
.tl-icon.arrival { border-color: var(--c-primary, var(--green)); background: var(--c-light, var(--green-light)); }

/* ===== Event content cards ===== */
.tl-content {
  min-width: 0;
}

/* --- Photo card (visit / flight) --- */
.tl-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.tl-photo.expanded {
  overflow: hidden;
}

.tl-photo > img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.tl-photo-hotel > img {
  height: 150px;
}

.tl-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--c-gradient, rgba(0,0,0,0.6)) 0%, transparent 55%);
}

.tl-photo-title {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  color: white;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  z-index: 2;
}

/* Hotel photo card: title + subtitle + buttons stacked at bottom */
.tl-photo-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  z-index: 2;
}

.tl-photo-info .tl-photo-title {
  position: static;
  font-size: 1.2rem;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.tl-photo-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.tl-photo-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.tl-photo-btn {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.15s;
}

.tl-photo-btn:hover {
  background: rgba(255,255,255,0.4);
}

/* --- Drive card --- */
.tl-drive {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.tl-nav-top {
  position: absolute;
  top: 12px;
  right: 12px;
  margin-top: 0;
}

.tl-drive-route {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tl-arrow { color: var(--c-primary, var(--text-muted)); }

.tl-drive-distance {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-primary, var(--text-secondary));
  margin-top: 4px;
}

.tl-drive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tl-pill {
  display: inline-block;
  background: var(--c-light, var(--blue-light));
  color: var(--c-primary, var(--blue));
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.tl-pill-nav {
  background: var(--c-primary, var(--blue));
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s;
}

.tl-pill-nav:hover { filter: brightness(0.85); }

.tl-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 8px 18px;
  background: var(--c-primary, var(--blue));
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.15s;
}

.tl-nav-btn:hover { filter: brightness(0.85); }

/* ===== Expandable cards ===== */
.tl-expandable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s var(--spring);
}

.tl-expandable:active {
  transform: scale(0.98);
}

.tl-expand-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 4px 0 0;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--spring-soft);
}
.tl-expand-hint .material-symbols-outlined { font-size: 18px; }

.tl-expand-hint-photo {
  position: absolute;
  bottom: 6px;
  right: 12px;
  color: rgba(255,255,255,0.7);
  z-index: 3;
  padding: 0;
}

.tl-expandable.expanded .tl-expand-hint {
  opacity: 0;
  transform: scale(0.8);
}

.tl-expanded {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease-out), opacity 0.3s var(--ease-out);
  opacity: 0;
  pointer-events: none;
}

.tl-expanded-inner {
  overflow: hidden;
}

.tl-expandable.expanded .tl-expanded {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

/* Photo cards: expanded section needs to be inside the card flow */
.tl-photo .tl-expanded {
  position: relative;
  z-index: 4;
  background: var(--bg-card);
  border-radius: 0 0 var(--radius) var(--radius);
}


/* ===== Action buttons grid ===== */
.tl-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 12px 8px;
}

.tl-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.25s var(--spring), background 0.2s var(--ease-out);
}

.tl-action:hover {
  background: var(--border);
  transform: scale(1.02);
}

.tl-action:active {
  transform: scale(0.96);
}

.tl-action-icon { font-size: 1.1rem; }
.tl-action-icon .material-symbols-outlined { font-size: 20px; }

/* Map embed in drive card */
.tl-map-wrap {
  padding: 0 12px;
  margin-bottom: 8px;
}

.tl-map-embed {
  width: 100%;
  height: 180px;
  border: none;
  border-radius: var(--radius-sm);
  display: block;
}

/* Staggered entrance for actions */
.tl-expandable.expanded .tl-action {
  animation: springIn 0.4s var(--spring) both;
}
.tl-expandable.expanded .tl-action:nth-child(1) { animation-delay: 0.05s; }
.tl-expandable.expanded .tl-action:nth-child(2) { animation-delay: 0.1s; }
.tl-expandable.expanded .tl-action:nth-child(3) { animation-delay: 0.15s; }
.tl-expandable.expanded .tl-action:nth-child(4) { animation-delay: 0.2s; }

@keyframes springIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Staggered entrance for city info */
.tl-expandable.expanded .tl-city-info > * {
  animation: springIn 0.4s var(--spring-soft) both;
}
.tl-expandable.expanded .tl-city-info > *:nth-child(1) { animation-delay: 0s; }
.tl-expandable.expanded .tl-city-info > *:nth-child(2) { animation-delay: 0.05s; }
.tl-expandable.expanded .tl-city-info > *:nth-child(3) { animation-delay: 0.1s; }
.tl-expandable.expanded .tl-city-info > *:nth-child(4) { animation-delay: 0.15s; }
.tl-expandable.expanded .tl-city-info > *:nth-child(5) { animation-delay: 0.2s; }
.tl-expandable.expanded .tl-city-info > *:nth-child(6) { animation-delay: 0.25s; }

/* Remove old photo action buttons (now in expanded) */
.tl-photo-actions { display: none; }
.tl-photo-info .tl-photo-actions { display: none; }

/* ===== City Info (expanded) ===== */
.tl-city-info {
  padding: 12px 12px 4px;
}

.tl-city-nickname {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--c-primary, var(--accent));
  font-weight: 600;
  margin-bottom: 4px;
}

.tl-city-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.tl-city-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tl-city-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
}
.tl-city-stat .material-symbols-outlined { font-size: 14px; color: var(--text-muted); }

.tl-city-facts {
  margin-bottom: 12px;
}

.tl-city-facts-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-primary, var(--accent));
  margin-bottom: 6px;
}
.tl-city-facts-title .material-symbols-outlined { font-size: 16px; }

.tl-city-fact {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.45;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.tl-city-fact:last-child {
  border-bottom: none;
}

.tl-city-mustsee {
  margin-bottom: 8px;
}

.tl-city-mustsee-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-city-mustsee-list .tl-pill {
  background: var(--c-light, var(--bg));
  color: var(--c-primary, var(--text));
  font-size: 0.72rem;
  padding: 4px 10px;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s;
}
.tl-city-mustsee-list .tl-pill:hover {
  filter: brightness(0.85);
}

/* --- Crime Index --- */
.tl-city-crime {
  margin-bottom: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.tl-crime-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.tl-crime-score {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.tl-crime-level {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 10px;
}

.tl-crime-source {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: auto;
}

.tl-crime-very-low .tl-crime-score,
.tl-crime-score.tl-crime-very-low { color: #16a34a; }
.tl-crime-level.tl-crime-very-low { background: #dcfce7; color: #15803d; }
.tl-crime-fill.tl-crime-very-low { background: #16a34a; }

.tl-crime-low .tl-crime-score,
.tl-crime-score.tl-crime-low { color: #65a30d; }
.tl-crime-level.tl-crime-low { background: #ecfccb; color: #4d7c0f; }
.tl-crime-fill.tl-crime-low { background: #65a30d; }

.tl-crime-moderate .tl-crime-score,
.tl-crime-score.tl-crime-moderate { color: #d97706; }
.tl-crime-level.tl-crime-moderate { background: #fef3c7; color: #b45309; }
.tl-crime-fill.tl-crime-moderate { background: #d97706; }

.tl-crime-high .tl-crime-score,
.tl-crime-score.tl-crime-high { color: #dc2626; }
.tl-crime-level.tl-crime-high { background: #fee2e2; color: #b91c1c; }
.tl-crime-fill.tl-crime-high { background: #dc2626; }

.tl-crime-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.tl-crime-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.tl-crime-watch {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-crime-item {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  padding-left: 12px;
  position: relative;
}

.tl-crime-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

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

/* --- Hotel card --- */
.tl-hotel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--c-primary, var(--accent));
}

.tl-hotel-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.tl-hotel-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.tl-hotel-city {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Hotel info (expanded) */
.tl-hotel-info {
  padding: 12px 12px 4px;
}

.tl-hotel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.tl-hotel-stars {
  color: #f5a623;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.tl-hotel-style {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-primary, var(--accent));
  background: var(--c-light, var(--accent-light));
  padding: 2px 8px;
  border-radius: 20px;
}

.tl-hotel-highlight {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.tl-hotel-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tl-hotel-amenity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
}
.tl-hotel-amenity .material-symbols-outlined { font-size: 14px; color: var(--text-muted); }

.tl-hotel-times {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
  margin-bottom: 4px;
}
.tl-hotel-times .material-symbols-outlined { font-size: 14px; color: var(--text-muted); }

.tl-hotel-time-sep {
  margin: 0 2px;
  color: var(--text-muted);
}

/* Staggered entrance for hotel info */
.tl-expandable.expanded .tl-hotel-info > * {
  animation: springIn 0.4s var(--spring-soft) both;
}
.tl-expandable.expanded .tl-hotel-info > *:nth-child(1) { animation-delay: 0s; }
.tl-expandable.expanded .tl-hotel-info > *:nth-child(2) { animation-delay: 0.05s; }
.tl-expandable.expanded .tl-hotel-info > *:nth-child(3) { animation-delay: 0.1s; }
.tl-expandable.expanded .tl-hotel-info > *:nth-child(4) { animation-delay: 0.15s; }

.tl-link {
  font-size: 0.75rem;
  color: var(--c-primary, var(--blue));
  text-decoration: none;
  font-weight: 600;
  margin-top: 4px;
  display: inline-block;
  margin-right: 10px;
}

.tl-link:hover { text-decoration: underline; }

/* --- Car card --- */
.tl-car {
  padding: 6px 0;
}

/* --- Shared --- */
.tl-evt-label {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 0;
}

.tl-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

.tl-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ===== Map ===== */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: calc(100dvh - var(--header-height) - var(--nav-height) - 80px);
  min-height: 400px;
}

/* ===== Country Tracker ===== */
/* ===== Passport stamps ===== */
.passport {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stamp {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: stampIn 0.4s var(--spring) both;
}

@keyframes stampIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.stamp-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--stamp-color, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.stamp-flag {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.stamp-ring .stamp-flag {
  font-size: 1.6rem;
}

.stamp-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.stamp-cities {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.stamp-detail {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stamp-mark {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--stamp-color, var(--accent));
  opacity: 0.25;
  border: 2px solid;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Locked (not yet visited) */
.stamp-locked {
  opacity: 0.5;
}

.stamp-locked .stamp-name {
  color: var(--text-muted);
}

/* Pass-through */
.stamp-pass {
  opacity: 0.6;
  padding: 10px 16px;
}

.stamp-pass .stamp-flag {
  font-size: 1.3rem;
  filter: grayscale(0.5);
}

.stamp-pass .stamp-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stamp-pass .stamp-detail {
  font-style: italic;
}

/* ===== Expenses placeholder ===== */
.placeholder { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.placeholder-icon { font-size: 3rem; margin-bottom: 12px; }
.placeholder-icon .material-symbols-outlined { font-size: 48px; }
.placeholder-text { font-size: 0.9rem; }

/* ===== Stats Grid (Today) ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; margin: 16px 0 0; }
.stats-grid-item { background: var(--bg-card); padding: 12px 6px; text-align: center; }
.stats-grid-value { font-size: 1.05rem; font-weight: 700; }
.stats-grid-total { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.stats-grid-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; font-weight: 600; }
.stats-progress { height: 4px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.stats-progress-bar { height: 100%; background: var(--tab-primary, var(--accent)); border-radius: 2px; transition: width 0.5s ease; }

/* ===== Meme of the Day ===== */
.meme-card {
  clip-path: inset(0 round var(--radius));
}
.meme-card iframe {
  width: 100%;
  min-height: 340px;
  display: block;
  border: none;
  pointer-events: none;
}

/* ===== Today Quicklinks ===== */
.today-quicklinks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.today-ql {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  transition: transform 0.25s var(--spring), background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.today-ql:hover {
  background: var(--border);
  transform: scale(1.03);
}

.today-ql:active {
  transform: scale(0.95);
}

.today-ql-icon { font-size: 1.3rem; }
.today-ql-icon .material-symbols-outlined { font-size: 24px; }

html.dark .ql-nightlife .today-ql-icon {
  color: oklch(0.75 0.22 350);
  text-shadow: 0 0 8px oklch(0.75 0.22 350 / 0.6), 0 0 20px oklch(0.75 0.22 350 / 0.3);
  animation: neonFlicker 3s infinite;
}

html.dark .ql-nightlife span:last-child {
  color: oklch(0.75 0.22 350);
}

@keyframes neonFlicker {
  0%, 100% { opacity: 1; }
  4% { opacity: 0.3; }
  6% { opacity: 1; }
  8% { opacity: 0.4; }
  9% { opacity: 1; }
  40% { opacity: 1; }
  42% { opacity: 0.6; }
  43% { opacity: 1; }
  56% { opacity: 1; }
  57% { opacity: 0.2; }
  58% { opacity: 0.7; }
  59% { opacity: 0.2; }
  60% { opacity: 1; }
  80% { opacity: 1; }
  82% { opacity: 0.5; }
  83% { opacity: 1; }
}

/* ===== Today Hero ===== */
.today-hero { border-radius: var(--radius); overflow: hidden; position: relative; min-height: 180px; display: flex; align-items: flex-end; }
.today-hero-photo { position: absolute; inset: 0; }
.today-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.today-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--c-gradient, rgba(0,0,0,0.7)) 0%, transparent 70%); }
.today-hero-content { position: relative; z-index: 2; padding: 16px; color: white; }
.today-hero .today-date-label { color: rgba(255,255,255,0.8); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.today-hero .today-city { font-size: 2.2rem; font-weight: 900; letter-spacing: -0.03em; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.today-hero .today-country { color: rgba(255,255,255,0.85); font-size: 0.85rem; margin-top: 2px; }

/* ===== Today Driving Summary ===== */
.today-driving-summary { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; margin-top: 12px; border-left: 3px solid var(--c-primary, var(--blue)); }
.today-driving-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; font-weight: 700; margin-bottom: 8px; }
.today-driving-total { font-weight: 600; color: var(--text-secondary); font-size: 0.75rem; }
.today-drive-leg { padding: 8px 0; border-top: 1px solid var(--border); }
.today-drive-route { font-size: 0.85rem; font-weight: 600; }
.today-drive-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.today-drive-leg .tl-pill-nav,
.today-drive-leg .tl-nav-btn { margin-top: 6px; }

/* ===== Today Activities ===== */
.today-activities { display: flex; flex-direction: column; gap: 6px; }
.today-activity { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.today-activity + .today-activity { border-top: 1px solid var(--border); }
.activity-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.activity-icon .material-symbols-outlined { font-size: 16px; }
.activity-icon.drive { background: var(--c-light, var(--blue-light)); }
.activity-icon.visit { background: var(--c-light, var(--green-light)); }
.activity-icon.hotel { background: var(--c-light, var(--accent-light)); }
.activity-icon.car { background: var(--accent-light); }
.activity-icon.flight { background: var(--blue-light); }
.activity-icon.arrival { background: var(--c-light, var(--green-light)); }
.activity-content { flex: 1; min-width: 0; }
.activity-label { font-size: 0.85rem; font-weight: 500; }
.activity-note { font-size: 0.75rem; color: var(--text-muted); font-style: italic; margin-top: 2px; }
.drive-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 4px; }

/* ===== Today Hotel ===== */
.today-hotel { background: var(--bg-card); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding: 14px; margin-top: 12px; border-left: 3px solid var(--c-primary, var(--accent)); }
.today-hotel-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-primary, var(--accent)); }
.today-hotel-name { font-size: 0.95rem; font-weight: 700; margin-top: 2px; }

/* ===== Today Photo Drop ===== */
.today-photo-drop {
  margin-top: 16px;
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.25s var(--spring);
}

.today-photo-drop:hover, .today-photo-drop.hl-dragover {
  border-color: var(--tab-primary, var(--accent));
  color: var(--tab-primary, var(--accent));
}

.today-photo-drop:active { transform: scale(0.98); }

/* ===== Route Preview ===== */
.route-preview { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.8; padding: 8px 0 16px; }
.route-stop { white-space: nowrap; }

/* ===== Highlights ===== */
.hl-upload {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.25s var(--spring);
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 16px;
}

.hl-upload:hover, .hl-upload.hl-dragover {
  border-color: var(--tab-primary, var(--accent));
  transform: scale(1.01);
}

.hl-upload:active {
  transform: scale(0.98);
}

.hl-upload-icon { font-size: 2.5rem; }
.hl-upload-icon .material-symbols-outlined { font-size: 48px; }
.hl-upload-text { font-size: 0.95rem; font-weight: 700; margin-top: 8px; }
.hl-upload-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Progress bar */
.hl-progress { margin-bottom: 16px; }
.hl-progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.hl-progress-fill { height: 100%; background: var(--tab-primary, var(--accent)); border-radius: 2px; transition: width 0.2s var(--ease-out); width: 0%; }
.hl-progress-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; text-align: center; }

/* Map */
.hl-map-container {
  height: 250px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

/* Story layout — grouped by city */
.hl-download-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.hl-download-all:hover { border-color: var(--accent); }
.hl-download-all .material-symbols-outlined { font-size: 18px; }

.hl-story { display: flex; flex-direction: column; gap: 24px; }

.hl-group-header {
  margin-bottom: 10px;
}

.hl-group-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hl-group-subtitle {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
}

.hl-group-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Photo grid within a group */
.hl-group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

.hl-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: springIn 0.4s var(--spring) both;
}

.hl-card-img {
  height: 120px;
  overflow: hidden;
}

.hl-grid-1 .hl-card-img { height: 220px; }
.hl-grid-2 .hl-card-img { height: 160px; }

.hl-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hl-card-meta {
  padding: 6px 8px;
}

.hl-meta-row {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hl-meta-muted {
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Circular photo markers on map ===== */
.map-photo-marker {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s var(--spring);
}

.map-photo-marker:hover {
  transform: scale(1.2);
  z-index: 10;
}

.map-photo-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Photo strip in timeline ===== */
.tl-photos-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.tl-photos-strip::-webkit-scrollbar { display: none; }

.tl-photos-thumb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.tl-photos-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl-photos-more {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tl-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0;
}

.tl-photos-full {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tl-photos-full img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.tl-photos-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 4px 6px;
  background: var(--bg-card);
}

/* ===== Past events: fade + red progress line ===== */
.tl-group.tl-past {
  opacity: 0.45;
}

.tl-group.tl-past .tl-photos-strip,
.tl-group.tl-past .tl-photos-thumb,
.tl-group.tl-past .tl-photos-grid,
.tl-group.tl-past .tl-photos-full {
  opacity: 1;
}

/* Red progress line at current time within today's group */
.tl-now-line {
  position: absolute;
  left: 62px;
  right: 0;
  top: var(--time-pct, 50%);
  height: 2px;
  background: #E53935;
  z-index: 5;
  pointer-events: none;
}

.tl-now-dot {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #E53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.25);
  animation: nowPulse 2s ease-in-out infinite;
}

@keyframes nowPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(229, 57, 53, 0.1); }
}

/* ===== Lightbox ===== */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}

.lb-overlay.lb-active {
  opacity: 1;
  pointer-events: auto;
}

.lb-img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
  transform: scale(0.9);
  transition: transform 0.35s var(--spring);
}

.lb-active .lb-img {
  transform: scale(1);
}

.lb-caption {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  margin-top: 12px;
  text-align: center;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.lb-close:hover {
  background: rgba(255,255,255,0.1);
}

.lb-download {
  position: absolute;
  bottom: 20px;
  right: 20px;
  color: rgba(255,255,255,0.7);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
  transition: background 0.2s;
}

.lb-download:hover {
  background: rgba(255,255,255,0.2);
}

.lb-download .material-symbols-outlined {
  font-size: 22px;
}

/* Make photo thumbs show pointer cursor */
.tl-photos-thumb, .tl-photos-full img, .hl-card-img img {
  cursor: pointer;
}

/* ===== Button (shared) ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; text-decoration: none; transition: all 0.15s; cursor: pointer; border: none; }
.btn-nav { background: var(--c-primary, var(--blue)); color: white; width: 100%; justify-content: center; }
.btn-nav:hover { filter: brightness(0.85); }

/* ===== User picker ===== */
.user-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px 16px;
}

.user-picker-route {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 320px;
  margin-bottom: 28px;
}

.user-picker-city {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.user-picker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.user-picker-line {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.user-picker-line svg {
  width: 100%;
  height: 2px;
}

.user-picker-km {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.user-picker-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text);
}

.user-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 360px;
}

.user-picker-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
  -webkit-tap-highlight-color: transparent;
  display: flex;
  justify-content: center;
}

.user-picker-btn:hover {
  transform: scale(1.08);
}

.user-picker-btn:active {
  transform: scale(0.95);
}

.user-picker-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  transition: border-color 0.2s;
}

.user-picker-btn:hover .user-picker-avatar,
.user-picker-btn.selected .user-picker-avatar {
  border-color: var(--accent);
}

.user-picker-btn.selected .user-picker-avatar {
  box-shadow: 0 0 0 3px var(--accent);
}

.user-picker-password {
  width: 100%;
  max-width: 360px;
  margin-top: 20px;
  text-align: center;
}

.user-picker-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  text-align: center;
  letter-spacing: 0.1em;
}

.user-picker-input:focus {
  outline: none;
  border-color: var(--accent);
}

.user-picker-error {
  color: oklch(0.65 0.2 25);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 8px;
}

.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ===== Currency converter ===== */
.converter {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  margin-top: 24px;
}

.converter-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.converter-input-row {
  display: flex;
  gap: 8px;
}

.converter-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
}

.converter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.converter-select {
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
}

.converter-result {
  margin-top: 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  min-height: 1.5em;
}

.converter-big {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.converter-big small, .converter-result small {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text-secondary);
}

.converter-sep {
  color: var(--text-muted);
  margin: 0 4px;
}

.converter-rate {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== Hero card ===== */
.hero-card {
  padding: 28px 20px 24px;
}

.hero-greeting {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-countdown {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 16px;
}

.hero-number {
  font-size: 4rem;
  font-weight: 900;
  color: var(--tab-primary, var(--accent));
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-number .material-symbols-outlined {
  font-size: 3.5rem;
}

.hero-unit {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Passport stamp strip in hero */
.passport-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.passport-stamp {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  filter: grayscale(1) opacity(0.35);
  transition: all 0.3s var(--spring);
}

.passport-stamp.stamped {
  filter: none;
  border-color: var(--stamp-color, var(--accent));
}

.passport-stamp-flag {
  font-size: 1.15rem;
}

.passport-stamp-check {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--stamp-color, var(--accent));
  color: white;
  font-size: 0.55rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.hero-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== World Clock ===== */
.world-clock {
  display: flex;
  justify-content: space-around;
  margin: 8px 0 0;
  padding: 10px 0;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.world-clock-zone {
  text-align: center;
  min-width: 80px;
}
.world-clock-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.world-clock-time {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ===== Bingo ===== */
.bingo-scores {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.bingo-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bingo-score.empty { opacity: 0.4; }

.bingo-score-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.bingo-score-num {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text);
}

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

.bingo-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: all 0.2s var(--spring);
  -webkit-tap-highlight-color: transparent;
}

.bingo-cell:active {
  transform: scale(0.93);
}

.bingo-cell-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

.bingo-cell.claimed {
  border-color: var(--accent);
  background: var(--accent-light);
}

.bingo-cell.claimed .bingo-cell-text {
  opacity: 0.5;
  font-size: 0.45rem;
}

.bingo-cell-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.bingo-cell.free {
  background: var(--accent-light);
  border-color: var(--accent);
  cursor: default;
}

.bingo-cell.free .bingo-cell-text {
  font-weight: 800;
  color: var(--accent);
}

.bingo-cell.mine {
  border-color: var(--accent);
}

/* ===== PWA install banner ===== */
.pwa-banner {
  position: fixed;
  bottom: calc(var(--nav-height) + 8px);
  left: 12px;
  right: 12px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.4s var(--spring), opacity 0.3s;
}

.pwa-banner-visible {
  transform: translateY(0);
  opacity: 1;
}

.pwa-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pwa-banner-text strong {
  font-size: 0.85rem;
  color: var(--text);
}

.pwa-banner-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pwa-banner-install {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  flex-shrink: 0;
}

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

/* ===== Music / Spotify ===== */
.music-connect-section { padding: 0 16px 8px; }

.music-connect-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: oklch(0.58 0.18 145);
  color: white; border: none; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: opacity 0.2s;
}
html.dark .music-connect-btn { background: oklch(0.50 0.16 145); }
.music-connect-btn:active { opacity: 0.8; }
.music-spotify-logo { flex-shrink: 0; }

.music-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.music-accounts-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }

.music-account {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.music-account.playing { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.music-account.playing:active { opacity: 0.9; }
.music-account.active { border-color: oklch(0.58 0.18 145); box-shadow: 0 0 0 1px oklch(0.58 0.18 145 / 0.3); }
html.dark .music-account.active { border-color: oklch(0.50 0.16 145); box-shadow: 0 0 0 1px oklch(0.50 0.16 145 / 0.3); }

.music-account-main { display: flex; align-items: center; gap: 12px; padding: 14px; }

.music-account-avatar-wrap { position: relative; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; }
.music-account-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.music-account-pulse {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid oklch(0.58 0.18 145);
  animation: musicPulse 2s ease-in-out infinite;
}
html.dark .music-account-pulse { border-color: oklch(0.80 0.18 145); }

@keyframes musicPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.1); }
}

.music-account-info { flex: 1; min-width: 0; }
.music-account-name { font-size: 0.9rem; font-weight: 600; }
.music-account-status { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.music-idle { color: var(--text-muted); }
.music-account-expand { color: var(--text-muted); font-size: 0.9rem; transition: transform 0.2s; }
.music-account.active .music-account-expand { transform: rotate(180deg); }

/* EQ bars animation */
.music-eq { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 12px; margin-right: 4px; vertical-align: middle; }
.music-eq span {
  display: block; width: 2.5px; border-radius: 1px;
  background: oklch(0.58 0.18 145);
  animation: eqBar 0.8s ease-in-out infinite alternate;
}
html.dark .music-eq span { background: oklch(0.80 0.18 145); }
.music-eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.music-eq span:nth-child(2) { height: 70%; animation-delay: 0.2s; }
.music-eq span:nth-child(3) { height: 50%; animation-delay: 0.4s; }
@keyframes eqBar { to { height: 100%; } }

/* Player card */
.music-player-card {
  margin: 8px 16px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; gap: 16px; align-items: center;
}

.music-player-art-wrap { flex-shrink: 0; }
.music-player-art {
  width: 88px; height: 88px; border-radius: var(--radius-sm);
  object-fit: cover; box-shadow: var(--shadow-sm);
}

.music-player-details { flex: 1; min-width: 0; }
.music-player-track { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-player-artist { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-player-album { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Player controls */
.music-player-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }
.music-ctrl-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: none; border: none; border-radius: 50%;
  color: var(--text); cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.music-ctrl-btn:active { opacity: 0.6; }
.music-ctrl-btn:disabled { opacity: 0.3; cursor: default; }
.music-ctrl-play {
  width: 42px; height: 42px;
  background: oklch(0.58 0.18 145); color: white; border-radius: 50%;
}
html.dark .music-ctrl-play { background: oklch(0.50 0.16 145); }
.music-ctrl-play:active { opacity: 0.8; }

.music-player-progress { margin-top: 10px; }
.music-player-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.music-player-bar-fill { height: 100%; background: oklch(0.58 0.18 145); border-radius: 2px; transition: width 0.5s linear; }
html.dark .music-player-bar-fill { background: oklch(0.80 0.18 145); }
.music-player-times { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-top: 4px; }

/* Search */
.music-search-section { padding: 8px 16px 24px; }
.music-search-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.88rem; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
}
.music-search-input:focus { border-color: oklch(0.58 0.18 145); }
html.dark .music-search-input:focus { border-color: oklch(0.50 0.16 145); }

.music-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.music-result:last-child { border-bottom: none; }
.music-result-art { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.music-result-info { flex: 1; min-width: 0; }
.music-result-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-result-artist { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.music-result-add {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.58 0.18 145); color: white;
  border: none; border-radius: 50%;
  font-size: 1.1rem; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: opacity 0.2s, background 0.2s;
}
html.dark .music-result-add { background: oklch(0.50 0.16 145); }
.music-result-add:active { opacity: 0.8; }
.music-result-add.added { background: var(--green); }
.music-result-add:disabled { opacity: 0.6; cursor: default; }

.music-no-results { padding: 20px 0; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.music-disconnect-btn {
  display: block; margin: 12px auto 0; padding: 6px 16px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 0.75rem; font-family: var(--font);
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.music-disconnect-btn:hover { color: oklch(0.55 0.2 25); border-color: oklch(0.55 0.2 25); }

/* ===== Utilities ===== */
.fade-in { animation: fadeIn 0.45s var(--spring-soft); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Desktop ===== */
@media (min-width: 768px) {
  .main { max-width: 640px; }
}
