/* ========== Weather ========== */
#weather {
  display: none;
}

#weather.active {
  display: block;
}

.weather-awareness {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.86) 0%, rgba(186, 230, 253, 0.72) 60%, rgba(224, 247, 250, 0.72) 100%);
  border-radius: 18px;
  padding: 28px 28px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(191, 219, 254, 0.56);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.weather-awareness::before {
  content: "🌤️";
  position: absolute;
  right: 28px;
  top: 16px;
  font-size: 4.5rem;
  opacity: 0.28;
}

.weather-awareness .page-title {
  color: #0c4a6e;
  margin-bottom: 4px;
  font-size: 1.6rem;
}

.weather-desc {
  font-size: 14px;
  color: #0369a1;
  margin-bottom: 16px;
}

.weather-search {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.weather-location-wrap {
  position: relative;
  display: inline-flex;
}

.weather-search input {
  padding: 12px 16px;
  border: 1.5px solid #7dd3fc;
  border-radius: 8px;
  width: 220px;
  font-size: 14px;
  background: #fff;
  color: #1a1a1a;
  outline: none;
}

.weather-search input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px #e0f2fe;
}

.weather-location-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 220px;
  z-index: 2500;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(125, 211, 252, 0.9);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.weather-location-suggestion {
  width: 100%;
  display: block;
  border: none;
  background: transparent;
  text-align: left;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.weather-location-suggestion:hover {
  background: rgba(14, 165, 233, 0.12);
}

.btn-search {
  background: var(--glass-blue-bg);
  color: #fff;
  border: 1px solid var(--glass-blue-border);
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--glass-blue-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-search:hover {
  background: var(--glass-blue-bg-strong);
  border-color: rgba(219, 234, 254, 0.72);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.weather-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.weather-card {
  border-radius: 16px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.weather-card-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
}

.weather-card:nth-child(1) {
  background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%);
  border-color: #99f6e4;
}

.weather-card:nth-child(1) .weather-card-title {
  color: #0f766e;
}

.weather-card:nth-child(1) .detail-row {
  color: #1e293b;
  font-size: 13px;
  margin-bottom: 12px;
}

.weather-card:nth-child(1) .detail-row strong {
  color: #0f766e;
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.weather-card:nth-child(2) {
  background: linear-gradient(145deg, #f0f9ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}

.weather-card:nth-child(2) .weather-card-title {
  color: #1d4ed8;
}

.weather-card:nth-child(2) .temp {
  color: #1e3a8a;
  font-size: 2.4rem;
}

.weather-card:nth-child(2) .weather-condition {
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 700;
}

.weather-card:nth-child(2) .feels-like {
  color: #64748b;
  margin-bottom: 20px;
}

.weather-card:nth-child(2) .weather-stats {
  color: #374151;
}

.weather-card:nth-child(2) .weather-stats strong {
  color: #1d4ed8;
  font-size: 11px;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 2px;
}

.advice-card {
  background: linear-gradient(145deg, #fdf4ff 0%, #fae8ff 100%) !important;
  border-color: #e9d5ff !important;
}

.advice-card .weather-card-title {
  color: #7e22ce !important;
}

.advice-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.advice-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
}

.advice-tip[data-cat="Outdoor Conditions"] {
  background: #fff0f6;
  border-color: #fbb6ce;
}

.advice-tip[data-cat="Outdoor Conditions"] .advice-label {
  color: #9d174d;
}

.advice-tip[data-cat="Outdoor Conditions"] .advice-badge {
  background: #fce7f3;
  color: #9d174d;
}

.advice-tip[data-cat="Attire"] {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.advice-tip[data-cat="Attire"] .advice-label {
  color: #6d28d9;
}

.advice-tip[data-cat="Attire"] .advice-badge {
  background: #ede9fe;
  color: #6d28d9;
}

.advice-tip[data-cat="Rain Advisory"] {
  background: #f0fdf4;
  border-color: #86efac;
}

.advice-tip[data-cat="Rain Advisory"] .advice-label {
  color: #15803d;
}

.advice-tip[data-cat="Rain Advisory"] .advice-badge {
  background: #dcfce7;
  color: #15803d;
}

.advice-tip[data-cat="Road Safety"] {
  background: #fff7ed;
  border-color: #fdba74;
}

.advice-tip[data-cat="Road Safety"] .advice-label {
  color: #c2410c;
}

.advice-tip[data-cat="Road Safety"] .advice-badge {
  background: #ffedd5;
  color: #c2410c;
}

.advice-tip.placeholder-tip {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.advice-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.advice-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.advice-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.advice-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.advice-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
  align-self: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-row {
  font-size: 13px;
  margin-bottom: 12px;
}

.current-weather {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.temp {
  font-size: 2rem;
  font-weight: 700;
}

.weather-condition {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feels-like {
  font-size: 13px;
  margin-bottom: 16px;
}

.weather-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 13px;
}

.hourly-forecast {
  margin-top: 28px;
}

.forecast-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.forecast-card {
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: linear-gradient(160deg, #f0f9ff 0%, #e0f2fe 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.forecast-card .time {
  font-size: 12px;
  font-weight: 700;
  color: #0284c7;
  letter-spacing: 0.05em;
}

.forecast-card .forecast-temp {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0c4a6e;
}

.forecast-card .forecast-desc {
  font-size: 11px;
  font-weight: 600;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.forecast-card .forecast-rain {
  font-size: 12px;
  color: #0369a1;
  background: #bae6fd;
  padding: 3px 8px;
  border-radius: 20px;
}

.sun-section {
  margin-top: 28px;
}

.sun-row {
  display: flex;
  align-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 50%, #fef3c7 100%);
  border: 1.5px solid #fde68a;
}

.sun-card {
  flex: 1;
  padding: 22px 16px;
  text-align: center;
}

.sun-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 6px;
}

.sun-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #92400e;
  margin-bottom: 4px;
}

.sun-time {
  font-size: 1.4rem;
  font-weight: 700;
  color: #78350f;
}

.sun-divider {
  width: 1px;
  height: 64px;
  background: #fcd34d;
  flex-shrink: 0;
}

.twoday-forecast {
  margin-top: 28px;
}

.twoday-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.twoday-card:nth-child(1) {
  border: 1.5px solid #7dd3fc;
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(145deg, #f0f9ff 0%, #bae6fd 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.twoday-card:nth-child(1) .twoday-label {
  background: #0284c7;
  color: #fff;
}

.twoday-card:nth-child(1) .twoday-desc {
  color: #0369a1;
}

.twoday-card:nth-child(1) .twoday-high {
  color: #0c4a6e;
}

.twoday-card:nth-child(1) .twoday-sep {
  color: #7dd3fc;
}

.twoday-card:nth-child(1) .twoday-low {
  color: #38bdf8;
}

.twoday-card:nth-child(1) .twoday-rain {
  background: #e0f2fe;
  color: #0369a1;
}

.twoday-card:nth-child(2) {
  border: 1.5px solid #c4b5fd;
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(145deg, #faf5ff 0%, #ede9fe 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.twoday-card:nth-child(2) .twoday-label {
  background: #7c3aed;
  color: #fff;
}

.twoday-card:nth-child(2) .twoday-desc {
  color: #6d28d9;
}

.twoday-card:nth-child(2) .twoday-high {
  color: #4c1d95;
}

.twoday-card:nth-child(2) .twoday-sep {
  color: #c4b5fd;
}

.twoday-card:nth-child(2) .twoday-low {
  color: #8b5cf6;
}

.twoday-card:nth-child(2) .twoday-rain {
  background: #ede9fe;
  color: #6d28d9;
}

.twoday-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 20px;
}

.twoday-icon {
  font-size: 2.6rem;
}

.twoday-desc {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.twoday-temps {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.twoday-high {
  font-size: 2rem;
  font-weight: 700;
}

.twoday-sep {
  font-size: 1.3rem;
}

.twoday-low {
  font-size: 1.2rem;
  font-weight: 500;
}

.twoday-rain {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.ml-traffic-impact {
  margin-top: 28px;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.impact-main-row {
  display: flex;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
}

.impact-ring-container {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.impact-ring {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 10px solid #22c55e;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-ring-inner {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.impact-score-num {
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 800;
  color: #166534;
}

.impact-score-denom {
  font-size: 13px;
  color: #64748b;
}

.impact-ring-label {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #475569;
}

.impact-ring.impact-low {
  border-color: #22c55e;
  background: #f0fdf4;
}

.impact-ring.impact-low .impact-score-num {
  color: #166534;
}

.impact-ring.impact-moderate {
  border-color: #eab308;
  background: #fefce8;
}

.impact-ring.impact-moderate .impact-score-num {
  color: #713f12;
}

.impact-ring.impact-high {
  border-color: #ea580c;
  background: #fff7ed;
}

.impact-ring.impact-high .impact-score-num {
  color: #9a3412;
}

.impact-ring.impact-severe {
  border-color: #dc2626;
  background: #fef2f2;
}

.impact-ring.impact-severe .impact-score-num {
  color: #7f1d1d;
}

.impact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.impact-level-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.impact-level-badge.impact-low {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.impact-level-badge.impact-moderate {
  background: #fef9c3;
  color: #713f12;
  border-color: #fde047;
}

.impact-level-badge.impact-high {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.impact-level-badge.impact-severe {
  background: #fee2e2;
  color: #7f1d1d;
  border-color: #fca5a5;
}

.impact-summary {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
}

.impact-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.impact-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  flex: 1;
  min-width: 160px;
}

.impact-meta-icon {
  font-size: 1.3rem;
}

.impact-meta-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 2px;
}

.impact-meta-val {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.impact-factors-panel {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.impact-factors-heading {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #64748b;
  text-transform: uppercase;
}

.factor-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.factor-label {
  width: 150px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.factor-bar-track {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.factor-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.factor-bar-rain {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.factor-bar-wind {
  background: linear-gradient(90deg, #a78bfa, #8b5cf6);
}

.factor-bar-vis {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.factor-bar-heat {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

.factor-val {
  width: 68px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-align: right;
}

.ml-model-badge {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.saved-locations {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 28px;
}

.saved-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #0369a1;
}

.saved-empty {
  font-size: 12px;
  color: #94a3b8;
}

.saved-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #7dd3fc;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
  cursor: pointer;
  transition: background 0.15s;
}

.saved-chip:hover {
  background: #e0f2fe;
}

.chip-remove {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1;
  margin-left: 2px;
}

.chip-remove:hover {
  color: #ef4444;
}

.btn-save-loc {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.34) 0%, rgba(29, 78, 216, 0.28) 100%);
  color: #eff6ff;
  border: 1px solid rgba(186, 230, 253, 0.56);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-save-loc:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.48) 0%, rgba(29, 78, 216, 0.38) 100%);
  border-color: rgba(224, 242, 254, 0.76);
  transform: translateY(-1px);
}

.weather-timestamp {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: #0369a1;
}

.btn-refresh-data {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.22) 0%, rgba(29, 78, 216, 0.16) 100%);
  border: 1px solid rgba(186, 230, 253, 0.56);
  color: #0f4c81;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-refresh-data:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.34) 0%, rgba(29, 78, 216, 0.24) 100%);
  transform: translateY(-1px);
}

/* for habit routes analysis panel */
.route-insight-panel {
  font-family: Arial, Helvetica, sans-serif;
  color: #1f2937;
}

.route-insight-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.route-insight-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 4px;
  text-transform: none;
}

.route-panel-section {
  padding: 13px 0;
  border-top: 1px solid #e5e7eb;
}

.route-panel-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 7px;
}

.route-panel-section-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 7px;
}

.route-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 14px;
}

.route-panel-row span {
  color: #64748b;
  font-weight: 600;
}

.route-panel-row strong {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.route-panel-note {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.route-condition-bar {
  display: flex;
  height: 9px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.route-cond-clear {
  background: #22c55e;
}

.route-cond-moderate {
  background: #f59e0b;
}

.route-cond-congested {
  background: #ef4444;
}

.route-condition-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 9px;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.route-condition-legend span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.route-condition-legend b {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.route-signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.route-signal-grid span {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 3px;
}

.route-signal-grid strong {
  display: block;
  font-size: 14px;
  color: #111827;
  font-weight: 700;
}

.route-bottleneck-road {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.route-bottleneck-meta {
  margin-top: 5px;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.route-bottleneck-reason {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.route-empty-note {
  font-size: 12px;
}

/* route navbar buttons */
.route-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 8px;
  height: 44px;
}

.route-sidebar-tab {
  flex: 1;
  height: 44px;
  padding: 0;
  border: none;
  background: white;
  font-size: 14px;
  font-weight: 700;
  line-height: 44px;
  cursor: pointer;
  color: #94a3b8;
}

.route-sidebar-tab.active {
  color: #111827;
  border-bottom: 2px solid #3b82f6;
}


.route-typical-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 14px;
  border-top: 1px solid #e5e7eb;
}

.route-typical-gauge {
  --healthy: 100%;
  --delay-color: #22c55e;

  width: 78px;
  height: 78px;
  border-radius: 50%;

  background: conic-gradient(from 20deg,
      #22c55e 0 var(--healthy),
      var(--delay-color) var(--healthy) 100%);

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.route-typical-gauge::before {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  z-index: 0;
}

.route-gauge-main {
  position: relative;
  z-index: 1;
  background: transparent !important;
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}


.route-gauge-sub {
  font-size: 9px;
  color: #64748b;
  margin-top: 3px;
}

.route-gauge-text {
  min-width: 0;
}

.route-gauge-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.route-gauge-note {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.route-typical-gauge-wrap.good .route-typical-gauge {
  --gauge-color: #22c55e;
}

.route-typical-gauge-wrap.normal .route-typical-gauge {
  --gauge-color: #22c55e;
}

.route-typical-gauge-wrap.warning .route-typical-gauge {
  --gauge-color: #f59e0b;
}

.route-typical-gauge-wrap.bad .route-typical-gauge {
  --gauge-color: #ef4444;
}

.route-typical-gauge-wrap.unavailable .route-typical-gauge {
  --gauge-color: #94a3b8;
}

.route-affected-list {
  display: grid;
  gap: 8px;
}

.route-affected-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.route-affected-row:last-child {
  border-bottom: none;
}

.route-affected-row strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
}

.route-affected-row span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
}

.route-affected-row b {
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
}

/* journey button */
.route-primary-action {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  padding-bottom: 4px;
}

#route-calculate-btn {
  height: 44px;
  min-width: 118px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

#route-calculate-btn:hover {
  background: #1d4ed8;
}

.route-actions .pref-btn,
.route-actions .btn-dark {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.route-primary-action button {
  border: none;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.route-primary-action .btn-icon {
  font-size: 11px;
  line-height: 1;
  padding-right: 2px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.route-primary-action span {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}

.hud-stop-link {
  display: none;
}

.habit-rename-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.habit-rename-save,
.habit-rename-cancel {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.habit-rename-save {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: white;
}

.habit-rename-save:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.habit-rename-cancel {
  border: 1px solid #e2e8f0;
  background: white;
  color: #64748b;
}

.habit-rename-cancel:hover {
  background: #f8fafc;
  color: #334155;
}

.habit-new-name-input {
  width: 100%;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #1e293b;
  background: white;
  box-sizing: border-box;
}

.habit-new-name-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* mobile view */
@media (max-width: 900px) {
  .journey-hud {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 14px !important;
    top: auto !important;

    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 38vh !important;

    border-radius: 22px !important;
    padding: 14px 16px !important;
    z-index: 9500 !important;

    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;

    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 -10px 38px rgba(15, 23, 42, 0.24) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }

  .journey-hud .hud-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    margin-bottom: 4px !important;
    padding-bottom: 4px !important;
  }

  .journey-hud .hud-stop-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 0 !important;
    height: 24px !important;
    padding: 3px 9px !important;
    margin: 0 !important;

    border: none !important;
    border-radius: 999px !important;
    background: #fee2e2 !important;
    color: #b91c1c !important;

    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: none !important;
  }

  .journey-hud .hud-road-info {
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 72px !important;
    margin-bottom: 6px !important;
    overflow: hidden !important;
  }

  .journey-hud .hud-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 120px !important;
    overflow-y: auto !important;
    padding-right: 4px !important;
  }

  .journey-hud .hud-footer {
    flex-shrink: 0 !important;
    margin-top: 6px !important;
    padding: 6px 8px !important;
  }

  .journey-hud.feedback-open {
    height: auto !important;
    max-height: 58vh !important;
  }

  .journey-hud.feedback-open .hud-body {
    max-height: 110px !important;
  }

  .drawer-trigger {
    padding: 8px !important;
    font-size: 11px !important;
  }

  #route-planner {
    overflow-x: hidden;
  }

  .route-planner-section {
    padding: 0 12px;
  }

  .page-title {
    font-size: 1.35rem;
    margin-bottom: 14px;
  }

  .route-inputs {
    width: 100%;
    max-width: none;
  }

  .input-row {
    display: grid !important;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    width: 100%;
  }

  .input-row .icon-pin,
  .input-row .icon-plane {
    align-self: center;
    justify-self: center;
  }

  .input-row input {
    width: 100% !important;
    min-width: 0 !important;
  }

  #route-calculate-btn {
    grid-column: 1 / -1;
    width: 100% !important;
    height: 48px;
    margin-top: 4px;
  }

  .route-planning-hint {
    margin-top: 12px;
    font-size: 13px;
    padding: 10px 12px;
  }

  .route-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
    width: 100%;
  }

  .route-map-area {
    width: 100% !important;
    min-width: 0 !important;
    order: 1;
  }

  #plannerMap {
    width: 100% !important;
    height: 420px !important;
    min-height: 420px !important;
    display: block !important;
    border-radius: 16px;
    overflow: hidden;
  }

  .route-details-panel {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    order: 2;
    margin: 0 !important;
    box-sizing: border-box;
  }

  .route-options {
    order: 3;
    width: 100%;
    margin-top: 16px;
  }

  .route-cards {
    grid-template-columns: 1fr !important;
  }

  .routes-legend {
    display: none;
  }

  .route-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: 12px !important;
  }

  #route-preference-btn {
    grid-column: 1 / -1 !important;
    height: 38px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    box-shadow: none !important;
    background: #eaf4ff !important;
    color: #1e3a8a !important;
  }

  #route-toggle-favorites-btn,
  #route-cancel-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    border-radius: 10px !important;
    font-size: 10.5px !important;
    box-shadow: none !important;
    background: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
  }

  #route-cancel-btn {
    color: #b91c1c !important;
    border-color: #fecaca !important;
    background: #fff7f7 !important;
  }

  .route-actions button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }

  .journey-hud .hud-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .journey-hud .hud-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .journey-hud .status-indicator {
    min-width: 0 !important;
  }

  .journey-hud .hud-stop-link {
    display: inline-block !important;
    padding: 3px 8px !important;
    border-radius: 999px !important;
    background: #fff7f7 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
  }


}


/* Mobile for saved habit route list inside Route Planner */
@media (max-width: 768px) {
  #habit-routes-list {
    display: grid !important;
    gap: 14px !important;
    padding: 0 !important;
    overflow: visible !important;
    max-height: none !important;
  }

  .habit-route-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border-radius: 18px !important;
  }

  .habit-route-card>div:first-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .habit-route-card [id^="title-"] {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  .habit-route-card .btn-rename-edit {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .habit-route-card>div:nth-child(2) {
    display: block !important;
    margin: 8px 0 12px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  .habit-route-card>div:nth-child(2) * {
    white-space: normal !important;
  }

  .habit-route-card>div:nth-child(3) {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  .habit-route-card .habit-load-btn,
  .habit-route-card .habit-alerts-btn,
  .habit-route-card .habit-delete-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
  }

  .habit-route-card .btn-rename-edit {
    position: absolute !important;
    top: 42px !important;
    right: 18px !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 2 !important;
    opacity: 0.65 !important;
  }

  #habit-routes-list .btn-rename-edit,
  .habit-route-card .btn-rename-edit {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
  }
}


@media (max-width: 900px) {
  body > #journey-hud {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 86px !important;
    top: auto !important;

    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 42vh !important;

    z-index: 99999 !important;
    border-radius: 22px !important;
    padding: 14px 16px !important;

    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 -10px 38px rgba(15, 23, 42, 0.24) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;

    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  body > #journey-hud.hidden {
    display: none !important;
  }

  body > #journey-hud .hud-body {
    max-height: 130px !important;
    overflow-y: auto !important;
  }

  body > #journey-hud .hud-road-info {
    max-height: 76px !important;
    overflow: hidden !important;
  }

  body > #journey-hud .hud-footer {
    margin-top: 8px !important;
    padding-top: 8px !important;
    background: transparent !important;
  }
}


