/* ============================================================
   TIER 7B FEATURES CSS — First Out App
   Features: Crowdsourced Conditions, Delay Tolerance Routing,
             Tube Heritage & Discovery, Walking Pace Calibration,
             Apple Watch / Wrist View Companion

   Integration:
     1. Add <link rel="stylesheet" href="/tier7b-features.css"> to <head>
     2. Add <script src="/tier7b-features.js" defer></script> before </body>
     3. The JS will inject HTML as needed — no manual HTML insertion required.
     4. CSS variables from the main app (--bg, --accent, etc.) are used.
   ============================================================ */


/* ============================================================
   13. CROWDSOURCED REAL-TIME CONDITIONS
   FAB button, report modal, conditions card, condition dots.
   ============================================================ */

/* --- Floating Action Button --- */

.crowd-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8B00 0%, #FF5630 100%);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 86, 48, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.crowd-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(255, 86, 48, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.crowd-fab:active {
  transform: scale(0.95);
}

.crowd-fab svg {
  width: 24px;
  height: 24px;
}

/* --- Report Modal --- */

.crowd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10000;
  animation: crowdModalIn 0.3s ease-out;
}

@keyframes crowdModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.crowd-modal-content {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated, #1E2340);
  border-radius: var(--radius, 14px) var(--radius, 14px) 0 0;
  padding: 24px 20px 32px;
  animation: crowdSlideUp 0.3s ease-out;
}

@keyframes crowdSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.crowd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.crowd-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin: 0;
}

.crowd-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary, #8B92A8);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.crowd-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.crowd-station-display {
  font-size: 14px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm, 10px);
}

/* --- Category Buttons --- */

.crowd-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.crowd-category-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #141829);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.crowd-category-btn:hover {
  background: var(--bg-card-hover, #1C2137);
  border-color: rgba(255, 255, 255, 0.15);
}

.crowd-category-btn.selected {
  border-color: var(--cat-color, var(--accent, #4C9AFF));
  background: color-mix(in srgb, var(--cat-color, var(--accent, #4C9AFF)) 10%, var(--bg-card, #141829));
  box-shadow: 0 0 0 1px var(--cat-color, var(--accent, #4C9AFF));
}

.crowd-cat-emoji {
  font-size: 20px;
  flex-shrink: 0;
}

.crowd-cat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #F0F2F8);
}

/* --- Note Input --- */

.crowd-note-section {
  margin-bottom: 16px;
  animation: crowdFadeIn 0.2s ease-out;
}

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

.crowd-note-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #141829);
  color: var(--text, #F0F2F8);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.crowd-note-input:focus {
  border-color: var(--accent, #4C9AFF);
}

.crowd-note-input::placeholder {
  color: var(--text-secondary, #8B92A8);
}

.crowd-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm, 10px);
  border: none;
  background: linear-gradient(135deg, #FF8B00 0%, #FF5630 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity 0.15s;
}

.crowd-submit-btn:hover {
  opacity: 0.9;
}

.crowd-submit-btn:active {
  opacity: 0.8;
}

/* --- Report Progress --- */

.crowd-report-progress {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(255, 255, 255, 0.04);
}

.crowd-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
  overflow: hidden;
}

.crowd-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #FF8B00, #FF5630);
  transition: width 0.3s ease;
}

.crowd-progress-label {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
}

/* --- Conditions Card --- */

.crowd-conditions-card {
  margin: 12px 0;
  padding: 16px;
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #141829);
  animation: crowdCardIn 0.3s ease-out;
}

@keyframes crowdCardIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.crowd-conditions-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.crowd-conditions-icon {
  font-size: 18px;
}

.crowd-conditions-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  flex: 1;
}

.crowd-conditions-count {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 8px;
}

.crowd-reports-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.crowd-report-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(255, 255, 255, 0.03);
  transition: opacity 0.3s;
}

.crowd-report-emoji {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.crowd-report-body {
  flex: 1;
  min-width: 0;
}

.crowd-report-text {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.crowd-report-time {
  display: block;
  font-size: 11px;
  color: var(--text-secondary, #8B92A8);
  margin-top: 2px;
}

.crowd-upvote-count {
  color: var(--green, #36B37E);
  font-weight: 600;
}

.crowd-sim-tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary, #8B92A8);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.crowd-upvote-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crowd-upvote-btn:hover {
  border-color: var(--green, #36B37E);
  color: var(--green, #36B37E);
}

.crowd-upvote-btn.upvoted {
  background: rgba(54, 179, 126, 0.15);
  border-color: var(--green, #36B37E);
  color: var(--green, #36B37E);
}

.crowd-add-report-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm, 10px);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.crowd-add-report-btn:hover {
  border-color: var(--accent, #4C9AFF);
  color: var(--accent, #4C9AFF);
  background: rgba(76, 154, 255, 0.06);
}

/* --- Condition Dots (on station list) --- */

.crowd-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.crowd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: crowdDotPulse 2s ease-in-out infinite;
}

@keyframes crowdDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}


/* ============================================================
   14. PERSONALIZED DELAY TOLERANCE ROUTING
   Reliability card, delay settings, safer alternative.
   ============================================================ */

.delay-reliability-card {
  margin: 12px 0;
  padding: 16px;
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #141829);
  animation: delayCardIn 0.3s ease-out;
}

@keyframes delayCardIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.delay-reliability-card.reliable {
  border-color: rgba(54, 179, 126, 0.25);
  background: linear-gradient(135deg, rgba(54, 179, 126, 0.05) 0%, var(--bg-card, #141829) 100%);
}

.delay-reliability-card.moderate {
  border-color: rgba(255, 171, 0, 0.25);
  background: linear-gradient(135deg, rgba(255, 171, 0, 0.05) 0%, var(--bg-card, #141829) 100%);
}

.delay-reliability-card.unreliable {
  border-color: rgba(255, 86, 48, 0.2);
  background: linear-gradient(135deg, rgba(255, 86, 48, 0.05) 0%, var(--bg-card, #141829) 100%);
}

.delay-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.delay-icon {
  font-size: 18px;
}

.delay-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
}

.delay-stars-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.delay-stars {
  font-size: 16px;
  letter-spacing: 2px;
}

.delay-score {
  font-size: 13px;
  font-weight: 700;
}

/* --- Time Profile Bar --- */

.delay-time-profile {
  margin-bottom: 12px;
}

.delay-time-bar {
  display: flex;
  gap: 2px;
  border-radius: var(--radius-sm, 10px);
  overflow: hidden;
}

.delay-time-segment {
  padding: 10px 8px;
  text-align: center;
  flex: 1;
  min-width: 0;
}

.delay-time-segment span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
}

.delay-time-segment small {
  display: block;
  font-size: 10px;
  color: var(--text-secondary, #8B92A8);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.delay-time-segment.best {
  background: rgba(54, 179, 126, 0.12);
}

.delay-time-segment.avg {
  background: rgba(255, 171, 0, 0.1);
}

.delay-time-segment.worst {
  background: rgba(255, 86, 48, 0.1);
}

/* --- Safer Alternative --- */

.delay-safer-alt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(54, 179, 126, 0.08);
  border-left: 3px solid var(--green, #36B37E);
}

.delay-alt-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.delay-alt-body {
  flex: 1;
  min-width: 0;
}

.delay-alt-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--green, #36B37E);
  margin-bottom: 2px;
}

.delay-alt-note {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.4;
}

/* --- Delay Settings Panel --- */

.delay-settings-panel {
  margin: 12px 0;
  padding: 16px;
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #141829);
}

.delay-settings-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.delay-settings-icon {
  font-size: 18px;
}

.delay-settings-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
}

.delay-slider-container {
  padding: 0 4px;
}

.delay-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  margin-bottom: 8px;
}

.delay-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #4C9AFF);
  cursor: pointer;
  border: 2px solid var(--bg-elevated, #1E2340);
  box-shadow: 0 2px 8px rgba(76, 154, 255, 0.4);
}

.delay-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #4C9AFF);
  cursor: pointer;
  border: 2px solid var(--bg-elevated, #1E2340);
  box-shadow: 0 2px 8px rgba(76, 154, 255, 0.4);
}

.delay-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 8px;
}

.delay-current-label {
  font-size: 13px;
  color: var(--accent, #4C9AFF);
  font-weight: 600;
  text-align: center;
}


/* ============================================================
   15. TUBE HERITAGE & DISCOVERY MODE
   Heritage card, discovery toggle, category filters, badges.
   ============================================================ */

/* --- Discovery Toggle --- */

.heritage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #141829);
  color: var(--text-secondary, #8B92A8);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.heritage-toggle:hover {
  background: var(--bg-card-hover, #1C2137);
}

.heritage-toggle.active {
  border-color: var(--amber, #FFAB00);
  background: rgba(255, 171, 0, 0.1);
  color: var(--amber, #FFAB00);
}

.heritage-toggle-icon {
  font-size: 16px;
}

.heritage-toggle-label {
  font-size: 12px;
}

/* --- Heritage Card --- */

.heritage-card {
  margin: 12px 0;
  border-radius: var(--radius, 14px);
  border: 1px solid rgba(255, 171, 0, 0.2);
  background: linear-gradient(160deg, rgba(40, 35, 25, 0.6) 0%, var(--bg-card, #141829) 100%);
  overflow: hidden;
  animation: heritageCardIn 0.4s ease-out;
}

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

.heritage-card-header {
  padding: 20px 16px 14px;
  position: relative;
}

.heritage-year {
  font-size: 48px;
  font-weight: 800;
  color: rgba(255, 171, 0, 0.25);
  line-height: 1;
  letter-spacing: -2px;
  font-family: 'Inter', sans-serif;
}

.heritage-era {
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  line-height: 1.4;
  margin-top: 4px;
  font-style: italic;
}

.heritage-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--hcat-color, var(--amber, #FFAB00)) 12%, transparent);
  color: var(--hcat-color, var(--amber, #FFAB00));
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Did You Know --- */

.heritage-did-you-know {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 171, 0, 0.1);
}

.heritage-dyk-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--amber, #FFAB00);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.heritage-dyk-fact {
  font-size: 14px;
  color: var(--text, #F0F2F8);
  line-height: 1.6;
  font-weight: 500;
}

/* --- More Facts --- */

.heritage-more-facts {
  border-top: 1px solid rgba(255, 171, 0, 0.1);
}

.heritage-more-summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  cursor: pointer;
  list-style: none;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.heritage-more-summary::-webkit-details-marker {
  display: none;
}

.heritage-more-summary::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 8px;
  font-size: 10px;
  transition: transform 0.2s;
}

details[open] > .heritage-more-summary::before {
  transform: rotate(90deg);
}

.heritage-more-summary:hover {
  color: var(--text, #F0F2F8);
}

.heritage-facts-list {
  list-style: none;
  padding: 0 16px 14px;
  margin: 0;
}

.heritage-fact-item {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text, #F0F2F8);
  line-height: 1.5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  padding-left: 16px;
}

.heritage-fact-item::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--amber, #FFAB00);
}

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

/* --- Hidden Detail --- */

.heritage-hidden {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(76, 154, 255, 0.06);
  border-top: 1px solid rgba(76, 154, 255, 0.12);
}

.heritage-hidden-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.heritage-hidden-text {
  font-size: 13px;
  color: var(--accent, #4C9AFF);
  line-height: 1.5;
  font-weight: 500;
}

/* --- Category Filters --- */

.heritage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 171, 0, 0.1);
}

.heritage-filter-pill {
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.heritage-filter-pill:hover {
  background: rgba(255, 255, 255, 0.06);
}

.heritage-filter-pill.active {
  border-color: var(--amber, #FFAB00);
  background: rgba(255, 171, 0, 0.12);
  color: var(--amber, #FFAB00);
}

/* --- Actions --- */

.heritage-actions {
  padding: 0 16px 14px;
}

.heritage-share-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.heritage-share-btn:hover {
  border-color: var(--accent, #4C9AFF);
  color: var(--accent, #4C9AFF);
}

/* --- Badge Progress --- */

.heritage-badge-progress,
.heritage-badge-earned {
  padding: 10px 16px 14px;
  font-size: 12px;
  color: var(--text-secondary, #8B92A8);
  border-top: 1px solid rgba(255, 171, 0, 0.1);
}

.heritage-badge-earned {
  color: var(--amber, #FFAB00);
  font-weight: 600;
}

/* --- Heritage Station Icon (on exit list) --- */

.heritage-station-icon {
  font-size: 14px;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0.8;
}


/* ============================================================
   16. SMART WALKING PACE CALIBRATION
   Pace presets, calibration panel, personalized time badge.
   ============================================================ */

.pace-calibration-panel {
  margin: 12px 0;
  padding: 16px;
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg-card, #141829);
}

.pace-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pace-header-icon {
  font-size: 18px;
}

.pace-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
}

.pace-current {
  font-size: 13px;
  color: var(--text-secondary, #8B92A8);
  margin-bottom: 14px;
}

.pace-current strong {
  color: var(--text, #F0F2F8);
}

/* --- Presets --- */

.pace-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.pace-preset-btn {
  padding: 12px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--bg, #0A0E1A);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pace-preset-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover, #1C2137);
}

.pace-preset-btn.active {
  border-color: var(--accent, #4C9AFF);
  background: rgba(76, 154, 255, 0.08);
  box-shadow: 0 0 0 1px var(--accent, #4C9AFF);
}

.pace-preset-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin-bottom: 2px;
}

.pace-preset-desc {
  display: block;
  font-size: 11px;
  color: var(--text-secondary, #8B92A8);
}

/* --- Calibrate Section --- */

.pace-calibrate-section {
  margin-bottom: 14px;
}

.pace-calibrate-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm, 10px);
  border: 1px dashed rgba(76, 154, 255, 0.3);
  background: rgba(76, 154, 255, 0.06);
  color: var(--accent, #4C9AFF);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.pace-calibrate-btn:hover {
  border-color: var(--accent, #4C9AFF);
  background: rgba(76, 154, 255, 0.1);
}

.pace-calibrate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pace-calibrate-status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--text, #F0F2F8);
  line-height: 1.5;
}

.pace-cal-countdown {
  text-align: center;
  font-weight: 600;
}

.pace-cal-countdown span {
  color: var(--accent, #4C9AFF);
  font-size: 18px;
  font-weight: 800;
}

/* --- Pace Modes --- */

.pace-mode-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
  margin-bottom: 10px;
}

.pace-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pace-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pace-mode-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pace-mode-btn.active {
  border-color: var(--accent, #4C9AFF);
  background: rgba(76, 154, 255, 0.08);
}

.pace-mode-emoji {
  font-size: 20px;
}

.pace-mode-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary, #8B92A8);
  text-align: center;
}

.pace-mode-btn.active .pace-mode-label {
  color: var(--accent, #4C9AFF);
}

/* --- Personalized Time Badge --- */

.pace-personalized-time {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(76, 154, 255, 0.06);
  border: 1px solid rgba(76, 154, 255, 0.15);
  animation: paceTimeIn 0.3s ease-out;
}

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

.pace-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #4C9AFF);
  background: rgba(76, 154, 255, 0.12);
  padding: 3px 8px;
  border-radius: 8px;
}

.pace-adjusted-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #F0F2F8);
}

.pace-note {
  font-size: 11px;
  color: var(--text-secondary, #8B92A8);
  width: 100%;
}


/* ============================================================
   17. APPLE WATCH / WEARABLE COMPANION (WRIST VIEW)
   Circular watch simulation, high-contrast minimal design.
   ============================================================ */

/* --- Wrist View Button --- */

.wrist-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--text-secondary, #8B92A8);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.wrist-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #F0F2F8);
}

/* --- Overlay --- */

.wrist-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: wristFadeIn 0.3s ease-out;
}

@keyframes wristFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wrist-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.wrist-close {
  position: absolute;
  top: -50px;
  right: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 1;
}

.wrist-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Watch Face --- */

.wrist-watch {
  width: 220px;
  height: 264px;
  border-radius: 44px;
  background: #000;
  border: 3px solid #333;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05),
              0 8px 32px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.wrist-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
}

.wrist-screen:active {
  opacity: 0.8;
}

/* --- Page Dots --- */

.wrist-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 12px;
}

.wrist-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
}

.wrist-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* --- Hint Text --- */

.wrist-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

/* --- PWA Prompt --- */

.wrist-pwa-prompt {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Watch Pages --- */

.wrist-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  animation: wristPageIn 0.25s ease-out;
}

@keyframes wristPageIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Time (top of every page) */
.wrist-time {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

/* Page 1: Commute Status */
.wrist-status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-bottom: 10px;
  box-shadow: 0 0 12px currentColor;
  animation: wristPulse 2s ease-in-out infinite;
}

@keyframes wristPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.wrist-line-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
}

.wrist-status-label {
  font-size: 13px;
  font-weight: 600;
}

/* Page 2: Positioning */
.wrist-position {
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 2px;
  line-height: 1;
}

.wrist-position-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.wrist-exit-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  max-width: 160px;
  line-height: 1.3;
}

/* Page 3: Next Train */
.wrist-countdown {
  font-size: 64px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 2px;
}

.wrist-countdown-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.wrist-frequency {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

/* Page 4: Daily Spend */
.wrist-spend-amount {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 2px;
}

.wrist-spend-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

.wrist-spend-bar {
  width: 140px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 6px;
}

.wrist-spend-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green, #36B37E), var(--accent, #4C9AFF));
  transition: width 0.3s ease;
}

.wrist-spend-cap {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}


/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 380px) {
  .crowd-categories {
    grid-template-columns: 1fr;
  }

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

  .wrist-watch {
    width: 190px;
    height: 228px;
    border-radius: 38px;
  }

  .wrist-position {
    font-size: 34px;
  }

  .wrist-countdown {
    font-size: 52px;
  }

  .wrist-spend-amount {
    font-size: 28px;
  }
}

@media (min-width: 768px) {
  .crowd-modal-content {
    border-radius: var(--radius, 14px);
  }

  .crowd-modal-overlay {
    align-items: center;
  }
}
