/* =========================================================
   MODERN DESIGN SYSTEM & VARIABLES
   ========================================================= */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Color Palette */
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #6366f1;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  
  --bg-page: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #93c5fd;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 8px 20px rgba(79, 70, 229, 0.15);
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   GATE LANDING PAGE ("Are we meeting on 29th?")
   ========================================================= */

.gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f1f5f9 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.gate-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

.gate-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.8);
  position: relative;
  animation: cardPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardPop {
  0% { transform: translateY(20px) scale(0.92); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.gate-badge {
  display: inline-block;
  background: var(--accent-gradient);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  box-shadow: var(--shadow-glow);
}

.gate-question {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 10px;
}

.gate-hint {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.gate-actions-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  position: relative;
}

.btn-gate-yes {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-gate-yes:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.45);
}

.btn-gate-yes:active {
  transform: translateY(0) scale(0.98);
}

.btn-gate-no {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10000;
  user-select: none;
}

.btn-gate-no:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fca5a5;
}

.gate-no-message {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e11d48;
  margin-top: 20px;
  min-height: 24px;
  transition: all 0.2s ease;
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */

.app-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-accent {
  color: var(--primary);
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* Segmented Navigation Control */
.nav-segmented {
  display: flex;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  gap: 4px;
}

.nav-segment {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.nav-segment:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.5);
}

.nav-segment.active {
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-badge {
  background: #f43f5e;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  transition: transform 0.2s ease;
}

.nav-segment.active .nav-badge {
  background: var(--primary);
}

/* =========================================================
   MAIN CONTAINER & TYPOGRAPHY
   ========================================================= */

.app-main {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}

.view-header {
  margin-bottom: 20px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Breadcrumbs bar */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: fit-content;
}

.breadcrumb-link {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

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

.breadcrumb-sep {
  color: var(--text-light);
}

/* =========================================================
   EXPLORE VIEW (CITIES & CATEGORIES)
   ========================================================= */

/* Hero City Selector Pills */
.city-selector-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}

.city-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.city-pill:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.city-pill.active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--primary-light);
}

.category-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.category-title {
  font-family: var(--font-heading);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
}

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Search Bar */
.search-container {
  position: relative;
  margin-bottom: 18px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
}

/* Places List */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.place-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.place-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.place-card-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.place-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.place-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.place-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.place-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Action Buttons */
.btn-add-itinerary {
  flex: 1;
  background: var(--surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-add-itinerary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.btn-add-itinerary.is-added {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.btn-add-itinerary.is-added:hover {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.btn-maps-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-maps-icon:hover {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

/* =========================================================
   DAY OUT PLANNER VIEW
   ========================================================= */

.planner-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live Traffic Status Strip */
.traffic-status-strip {
  background: var(--text-main);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.traffic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.traffic-badge.red {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.traffic-badge.yellow {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  border: 1px solid #f59e0b;
}

.traffic-badge.green {
  background: rgba(16, 185, 129, 0.25);
  color: #86efac;
  border: 1px solid #10b981;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseAnim 1.6s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.btn-sync-now {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-sync-now:hover {
  background: #ffffff;
  color: var(--text-main);
}

/* Optimization Banner */
.optimize-callout {
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-glow);
}

.optimize-callout-text {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-optimize-action {
  background: #ffffff;
  color: var(--primary-dark);
  border: none;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease;
}

.btn-optimize-action:hover {
  transform: scale(1.03);
}

/* Stops Sequence List */
.stops-sequence {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.stop-row {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.15s ease;
}

.stop-row.completed {
  background: #f8fafc;
  opacity: 0.65;
}

.stop-row.completed .stop-row-name {
  text-decoration: line-through;
}

.stop-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.stop-index-badge {
  background: var(--text-main);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stop-row-details {
  min-width: 0;
}

.stop-row-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-row-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stop-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-tool {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool:hover:not(:disabled) {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-tool:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-tool-del:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Custom Stop Input Form */
.custom-stop-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.input-custom {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--surface);
}

.input-custom:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-add-custom {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-add-custom:hover {
  background: #e2e8f0;
}

.btn-gps-start {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px dashed var(--primary);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-gps-start:hover {
  background: #dbeafe;
}

/* Form Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.input-control {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-main);
  background: var(--surface);
}

.input-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Route Master Banner */
.route-master-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.route-master-info h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.route-master-info p {
  font-size: 0.88rem;
  color: #cbd5e1;
}

.btn-launch-maps {
  background: #22c55e;
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  transition: all 0.15s ease;
}

.btn-launch-maps:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

/* Stats Metrics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =========================================================
   TIMELINE ENGINE
   ========================================================= */

.itinerary-timeline {
  position: relative;
  margin: 20px 0 10px;
  padding-left: 32px;
}

.itinerary-timeline::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: #cbd5e1;
}

.timeline-entry {
  position: relative;
  margin-bottom: 16px;
}

.timeline-entry:last-child {
  margin-bottom: 0;
}

.timeline-node {
  position: absolute;
  left: -32px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-main);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--surface);
  z-index: 2;
}

.timeline-node.start {
  background: var(--primary);
}

.timeline-node.end {
  background: #f43f5e;
}

.timeline-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.timeline-bubble.is-checked {
  background: #f8fafc;
  opacity: 0.75;
}

.bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.bubble-time-badge {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.bubble-duration {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bubble-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.bubble-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.bubble-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-check-visited {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-check-visited.checked {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.btn-nav-leg {
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.btn-nav-leg:hover {
  background: var(--primary-dark);
}

/* Transit Connector Card between stops */
.timeline-transit-leg {
  position: relative;
  margin: 12px 0 12px -16px;
  padding: 10px 14px 10px 28px;
  background: var(--surface-subtle);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.transit-leg-desc {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  flex-wrap: wrap;
}

.tag-traffic {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.tag-traffic.heavy {
  background: #fee2e2;
  color: #991b1b;
}

.tag-traffic.moderate {
  background: #fef3c7;
  color: #92400e;
}

.tag-traffic.low {
  background: #ecfdf5;
  color: #065f46;
}

.btn-transit-dir {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-transit-dir:hover {
  background: var(--text-main);
  color: #ffffff;
}

/* Footer Export Bar */
.footer-export-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-export-primary {
  background: #10b981;
  color: #ffffff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  transition: all 0.15s ease;
}

.btn-export-primary:hover {
  background: #059669;
}

.btn-export-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-export-secondary:hover {
  background: var(--surface-subtle);
}

/* Floating Back Button */
.floating-back-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  transition: all 0.15s ease;
}

.floating-back-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* Toast Notifications */
.toast-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideToast 2.6s forwards;
  z-index: 999;
}

@keyframes slideToast {
  0% { transform: translateY(20px); opacity: 0; }
  15% { transform: translateY(0); opacity: 1; }
  85% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

/* Responsive */
@media (max-width: 650px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-segmented {
    width: 100%;
  }

  .nav-segment {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

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

  .route-master-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-launch-maps {
    width: 100%;
    justify-content: center;
  }

  .traffic-status-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-sync-now {
    width: 100%;
    justify-content: center;
  }
}
