/* ==========================================================================
   DRIVVO AUTOMOTIVE INTELLIGENCE — APPLE MINIMAL DESIGN SYSTEM
   Vehicle: Honda Cross Tour (3.5L V6 i-VTEC)
   Aesthetic: Apple Human Interface Guidelines / macOS Sequoia & iOS 18
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Apple System Palette — Light Mode Default */
  --bg-canvas: #F5F5F7;
  --bg-card: #FFFFFF;
  --bg-card-translucent: rgba(255, 255, 255, 0.82);
  --bg-card-elevated: #FFFFFF;
  --bg-subtle: #F0F0F2;
  --bg-subtle-hover: #E5E5EA;
  --bg-secondary: #EBEBED;

  /* Borders & Dividers */
  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-hover: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.18);

  /* Apple System Accent Colors */
  --apple-blue: #0071E3;
  --apple-blue-hover: #0077ED;
  --apple-blue-subtle: rgba(0, 113, 227, 0.1);
  --apple-green: #34C759;
  --apple-green-subtle: rgba(52, 199, 89, 0.12);
  --apple-orange: #FF9500;
  --apple-orange-subtle: rgba(255, 149, 0, 0.12);
  --apple-purple: #AF52DE;
  --apple-purple-subtle: rgba(175, 82, 222, 0.12);
  --apple-red: #FF3B30;
  --apple-red-subtle: rgba(255, 59, 48, 0.12);
  --apple-indigo: #5856D6;
  --apple-indigo-subtle: rgba(88, 86, 214, 0.12);
  --apple-teal: #30B0C7;
  --apple-teal-subtle: rgba(48, 176, 199, 0.12);
  --apple-amber: var(--apple-orange);
  --apple-amber-subtle: var(--apple-orange-subtle);

  /* Apple Typography Scale */
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --text-tertiary: #A1A1A6;
  --text-inverted: #FFFFFF;

  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", -system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 12px 32px -4px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 20px 48px -8px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);

  /* Corner Geometry */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* Transitions */
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-quick: 0.18s;
  --duration-normal: 0.28s;
}

/* ==========================================================================
   Apple OLED Dark Mode (System Backgrounds)
   ========================================================================== */
[data-theme="dark"] {
  --bg-canvas: #000000;
  --bg-card: #1C1C1E;
  --bg-card-translucent: rgba(28, 28, 30, 0.76);
  --bg-card-elevated: #2C2C2E;
  --bg-subtle: #2C2C2E;
  --bg-subtle-hover: #3A3A3C;
  --bg-secondary: #141416;

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-strong: rgba(255, 255, 255, 0.28);

  --apple-blue: #0A84FF;
  --apple-blue-hover: #409CFF;
  --apple-blue-subtle: rgba(10, 132, 255, 0.16);
  --apple-green: #30D158;
  --apple-green-subtle: rgba(48, 209, 88, 0.16);
  --apple-orange: #FF9F0A;
  --apple-orange-subtle: rgba(255, 159, 10, 0.16);
  --apple-purple: #BF5AF2;
  --apple-purple-subtle: rgba(191, 90, 242, 0.16);
  --apple-red: #FF453A;
  --apple-red-subtle: rgba(255, 69, 58, 0.16);
  --apple-indigo: #5E5CE6;
  --apple-indigo-subtle: rgba(94, 92, 230, 0.16);
  --apple-teal: #64D2FF;
  --apple-teal-subtle: rgba(100, 210, 255, 0.16);

  --text-primary: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-tertiary: #636366;
  --text-inverted: #000000;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-card-hover: 0 14px 42px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.14);
  --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.16);
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-system);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.011em;
}

/* Subtle Apple Vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--apple-blue-subtle) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ==========================================================================
   Apple Navigation Bar (Glassmorphic Top Bar)
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  background: var(--bg-card-translucent);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--duration-normal) var(--ease-apple);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cockpit-logo-mark {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--apple-blue), #0051A8);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
}

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

.brand-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--apple-blue);
  background: var(--apple-blue-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ==========================================================================
   Header Mode Segmented Control (Detailed vs Simple)
   ========================================================================== */
.header-mode-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  gap: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mode-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 1.05rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-apple);
  user-select: none;
}

.mode-tab-btn:hover {
  color: var(--text-primary);
}

.mode-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0.5px 1.5px rgba(0, 0, 0, 0.05);
}

.mode-tab-btn svg {
  color: currentColor;
  opacity: 0.8;
}

.mode-tab-btn.active svg {
  color: var(--apple-blue);
  opacity: 1;
}

@media (max-width: 820px) {
  .top-nav {
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
  }
  .header-mode-toggle {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .mode-tab-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   Apple-Style Buttons & Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 0.95rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration-quick) var(--ease-apple);
  user-select: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary Apple Button */
.btn-primary,
.btn-telemetry {
  background: var(--apple-blue);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.28);
}

.btn-primary:hover,
.btn-telemetry:hover {
  background: var(--apple-blue-hover);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.38);
}

/* Subtle Secondary Glass Button */
.btn-subtle {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-subtle:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-hover);
}

/* Excel Specialty Button */
.btn-excel {
  background: rgba(16, 124, 65, 0.12);
  color: #107C41;
  border: 1px solid rgba(16, 124, 65, 0.24);
  font-weight: 600;
}

[data-theme="dark"] .btn-excel {
  background: rgba(48, 209, 88, 0.15);
  color: #30D158;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.btn-excel:hover {
  background: #107C41;
  color: #FFFFFF;
  border-color: #107C41;
  box-shadow: 0 4px 14px rgba(16, 124, 65, 0.32);
}

[data-theme="dark"] .btn-excel:hover {
  background: #30D158;
  color: #000000;
  border-color: #30D158;
  box-shadow: 0 4px 14px rgba(48, 209, 88, 0.4);
}

/* Circular Icon Button */
.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-quick) var(--ease-apple);
  box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-icon:active {
  transform: scale(0.92);
}

/* ==========================================================================
   Layout Container & Main Structure
   ========================================================================== */
.dashboard-container {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 2rem 1.8rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* General Apple Surface Card */
.apple-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-apple);
  position: relative;
}

.apple-card:hover {
  box-shadow: var(--shadow-card-hover);
}

/* ==========================================================================
   Hero Command Section (Vehicle Stage & Live Metrics)
   ========================================================================== */
.hero-telemetry-unit {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  align-items: center;
  overflow: hidden;
}

@media (max-width: 1040px) {
  .hero-telemetry-unit {
    grid-template-columns: 1fr;
  }
}

/* Vehicle Showcase Stage */
.hero-chassis-stage {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-subtle);
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.hero-vehicle-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--ease-apple);
}

.hero-chassis-stage:hover .hero-vehicle-img {
  transform: scale(1.02);
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

/* Subtle Coordinates Overlay */
.hud-coordinates {
  position: absolute;
  top: 1rem;
  left: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hud-tag {
  color: var(--apple-blue);
  font-weight: 600;
}

/* Interactive Component Hotspots */
.chassis-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transform: translate(-50%, -50%);
  transition: transform var(--duration-quick) var(--ease-apple);
  z-index: 10;
}

.hotspot-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--apple-blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.28);
  position: relative;
  transition: all var(--duration-quick) var(--ease-apple);
}

.hotspot.emerald .hotspot-dot {
  background: var(--apple-green);
  box-shadow: 0 0 0 4px var(--apple-green-subtle);
}

.hotspot.amber .hotspot-dot {
  background: var(--apple-orange);
  box-shadow: 0 0 0 4px var(--apple-orange-subtle);
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

.hotspot:hover .hotspot-dot {
  box-shadow: 0 0 0 7px rgba(0, 113, 227, 0.35);
}

.hotspot-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity var(--duration-quick) var(--ease-apple);
}

.hotspot:hover .hotspot-label {
  opacity: 1;
}

/* Right Readout Panel (Apple HUD) */
.cockpit-readout-panel {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.vehicle-identity {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vehicle-classification {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--apple-blue);
  letter-spacing: 0.04em;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 0 3px var(--apple-green-subtle);
}

.vehicle-model-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
}

.vehicle-spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.spec-pill {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
}

/* Mechanical-Modern Odometer Card */
.odometer-instrument {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.odo-label-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.odo-status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--apple-green);
  font-size: 0.72rem;
  font-weight: 600;
}

.blinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--apple-green);
  animation: pulse 2s infinite ease-in-out;
}

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

.odo-digits-container {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.odo-digits {
  font-family: var(--font-system);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.odo-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Apple-Style Metric Triplets (Health / Fitness Rings aesthetic) */
.cockpit-triplets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

@media (max-width: 640px) {
  .cockpit-triplets {
    grid-template-columns: 1fr;
  }
}

.triplet-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: transform var(--duration-quick) var(--ease-apple);
}

.triplet-box:hover {
  transform: translateY(-2px);
  background: var(--bg-subtle-hover);
}

.triplet-caption {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.triplet-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.triplet-sub {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* ==========================================================================
   Section Headers (Apple Typography)
   ========================================================================== */
.section-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.section-hud-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-hud-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Predictive Health Grid (Apple Health Style Wear Matrix)
   ========================================================================== */
.telemetry-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.15rem;
}

.telemetry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-apple);
  position: relative;
}

.telemetry-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.tel-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.tel-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tel-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.tel-card-date {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.tel-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.tel-badge.prime-emerald {
  background: var(--apple-green-subtle);
  color: var(--apple-green);
}

.tel-badge.active-amber {
  background: var(--apple-orange-subtle);
  color: var(--apple-orange);
}

.tel-badge.future-purple {
  background: var(--apple-purple-subtle);
  color: var(--apple-purple);
}

/* Apple Smooth Progress Bar */
.meter-track-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.meter-scale-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.meter-scale-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.8s var(--ease-apple);
}

.meter-scale-fill.fill-cyan {
  background: var(--apple-blue);
}

.meter-scale-fill.fill-emerald {
  background: var(--apple-green);
}

.meter-scale-fill.fill-purple {
  background: var(--apple-purple);
}

.meter-scale-fill.fill-amber {
  background: var(--apple-orange);
}

.meter-legend-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.tel-footer-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.tel-footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tel-footer-col .val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Thermodynamics & Kuwait Climate Lab (Apple Style Callout)
   ========================================================================== */
.thermo-lab-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  box-shadow: var(--shadow-card);
}

@media (max-width: 900px) {
  .thermo-lab-section {
    grid-template-columns: 1fr;
  }
}

.thermo-info-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.thermo-headline {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.thermo-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.thermo-contrast-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

.contrast-card {
  padding: 1.15rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contrast-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contrast-val {
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.contrast-card.winter .contrast-val {
  color: var(--apple-blue);
}

.contrast-card.summer .contrast-val {
  color: var(--apple-orange);
}

.contrast-sub {
  font-size: 0.74rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Future Service & Running Cost Simulator (Apple Slider UX)
   ========================================================================== */
.throttle-calculator-box {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  box-shadow: var(--shadow-card);
  align-items: center;
}

@media (max-width: 900px) {
  .throttle-calculator-box {
    grid-template-columns: 1fr;
  }
}

.throttle-control-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.throttle-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.throttle-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.throttle-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.throttle-val-readout {
  font-size: 1rem;
  font-weight: 700;
  color: var(--apple-blue);
  font-variant-numeric: tabular-nums;
}

/* Minimalist Range Input */
.cockpit-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-subtle-hover);
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
}

.cockpit-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.1s var(--ease-apple);
}

.cockpit-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.throttle-results-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.throttle-result-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.throttle-result-tile.featured {
  background: var(--apple-blue-subtle);
  border-color: rgba(0, 113, 227, 0.25);
}

.tile-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tile-number {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tile-sub {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Analytics Charts Grid
   ========================================================================== */
.charts-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.15rem;
}

.cockpit-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }

@media (max-width: 900px) {
  .col-8, .col-6, .col-4 {
    grid-column: span 12;
  }
}

.chart-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chart-hud-title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.chart-hud-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.chart-canvas-container {
  position: relative;
  width: 100%;
  height: 270px;
}

/* ==========================================================================
   Master Service & Telemetry Ledger (Apple Table UX)
   ========================================================================== */
.ledger-matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ledger-hud-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.telemetry-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
}

.telemetry-search-box svg {
  position: absolute;
  left: 0.85rem;
  color: var(--text-tertiary);
  pointer-events: none;
}

.telemetry-search-input {
  width: 100%;
  padding: 0.52rem 0.85rem 0.52rem 2.2rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-system);
  font-size: 0.82rem;
  outline: none;
  transition: all var(--duration-quick) var(--ease-apple);
}

.telemetry-search-input:focus {
  background: var(--bg-card);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px var(--apple-blue-subtle);
}

/* Apple Segmented Control */
.filter-switchgear {
  display: inline-flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border-subtle);
}

.switch-pill {
  border: none;
  background: transparent;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-system);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-quick) var(--ease-apple);
}

.switch-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Modern Apple Table */
.ledger-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.cockpit-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.cockpit-table th {
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.cockpit-table th:hover {
  color: var(--text-primary);
}

.cockpit-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cockpit-table tbody tr {
  cursor: pointer;
  transition: background var(--duration-quick) var(--ease-apple);
}

.cockpit-table tbody tr:hover {
  background: var(--bg-subtle);
}

.cockpit-table tbody tr:last-child td {
  border-bottom: none;
}

/* Category Badges */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
}

.type-badge.fuel {
  background: var(--apple-orange-subtle);
  color: var(--apple-orange);
}

.type-badge.service {
  background: var(--apple-green-subtle);
  color: var(--apple-green);
}

.type-badge.expense {
  background: var(--apple-purple-subtle);
  color: var(--apple-purple);
}

/* ==========================================================================
   Side Sheet / Record Inspector (iOS / macOS Style Slide-Over)
   ========================================================================== */
.inspector-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-apple);
}

.inspector-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.inspector-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background: var(--bg-card);
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-apple);
}

.inspector-drawer-backdrop.open .inspector-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.drawer-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  overflow-y: auto;
}

.drawer-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.drawer-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.drawer-detail-item .lbl {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drawer-detail-item .val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Apple Sheet Modal Dialog
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-apple);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  transform: scale(0.95);
  transition: transform var(--duration-normal) var(--ease-apple);
  overflow: hidden;
}

/* Grab handle for bottom sheet (hidden on desktop) */
.bottom-sheet-grab-bar {
  display: none;
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.modal-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-height: 75vh;
  overflow-y: auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-system);
  font-size: 0.88rem;
  outline: none;
  transition: all var(--duration-quick) var(--ease-apple);
}

.form-input:focus,
.form-select:focus {
  background: var(--bg-card);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px var(--apple-blue-subtle);
}

/* Event Type Segmented Control */
.event-type-switchgear {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  width: 100%;
}

.event-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.6rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-quick) var(--ease-apple);
}

.event-pill:hover {
  color: var(--text-primary);
}

.event-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Petrol Station Selector Pills */
.station-pills {
  display: flex;
  gap: 0.45rem;
  width: 100%;
}

.station-pill {
  flex: 1;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-quick) var(--ease-apple);
}

.station-pill:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
}

.station-pill.active {
  background: var(--apple-blue-subtle);
  border-color: var(--apple-blue);
  color: var(--apple-blue);
  font-weight: 600;
}

/* Apple-style iOS Toggle Switch */
.apple-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: all var(--duration-quick) var(--ease-apple);
}

.apple-toggle-wrapper:hover {
  background: var(--bg-subtle-hover);
}

.apple-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.apple-toggle-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.apple-toggle-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.apple-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.apple-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.apple-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-strong);
  transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 28px;
}

.apple-switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
}

.apple-switch input:checked + .apple-switch-slider {
  background-color: var(--apple-green);
}

.apple-switch input:checked + .apple-switch-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Apple Checkbox Cards for Export Options
   ========================================================================== */
.export-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.export-checkbox-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: all var(--duration-quick) var(--ease-apple);
}

.export-checkbox-card:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-hover);
}

.export-checkbox-card.checked {
  background: var(--apple-blue-subtle);
  border-color: rgba(0, 113, 227, 0.32);
}

.apple-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  accent-color: var(--apple-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.chk-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.chk-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chk-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chk-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.chk-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.chk-badge.service {
  background: var(--apple-green-subtle);
  color: var(--apple-green);
}

.chk-badge.fuel {
  background: var(--apple-orange-subtle);
  color: var(--apple-orange);
}

.chk-badge.expense {
  background: var(--apple-purple-subtle);
  color: var(--apple-purple);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

/* ==========================================================================
   Apple-Style Floating Notification Toast
   ========================================================================== */
.apple-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: var(--bg-card-translucent);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevated);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-apple);
}

.apple-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Elegance — Nav Elevation, Focus, Motion & Scroll Reveal
   ========================================================================== */

/* Nav lifts subtly once the user scrolls */
.top-nav.scrolled {
  border-bottom-color: var(--border-hover);
  box-shadow: var(--shadow-card);
}

/* Keyboard-only focus rings (clean on mouse click) */
:where(button, a, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--apple-blue);
  outline-offset: 2px;
}
.cockpit-table th:focus-visible,
.switch-pill:focus-visible {
  outline-offset: -3px;
}

/* Scroll-reveal — opt-in via .js-reveal so no-JS users always see content */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-apple), transform 0.65s var(--ease-apple);
  will-change: opacity, transform;
}
.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Honor users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   View Panels (Detailed vs Simple)
   ========================================================================== */
.view-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  animation: fadeInPanel 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   Simple (Buyer View) Components
   ========================================================================== */
.buyer-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.25rem 2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}




.buyer-hero-title {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.buyer-hero-lead {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 820px;
  margin-bottom: 1.85rem;
}

.buyer-hero-lead strong {
  color: var(--text-primary);
}

.buyer-quick-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .buyer-quick-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .buyer-quick-metrics {
    grid-template-columns: 1fr;
  }
}


/* Split Layout (Photo Slider Left, Stacked Metric Cards Right) */
.buyer-showcase-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 1.25rem;
}

@media (max-width: 960px) {
  .buyer-showcase-split {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.buyer-split-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.buyer-split-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.buyer-stacked-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  justify-content: space-between;
}

.buyer-metric-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform var(--duration-quick) var(--ease-apple);
}

.buyer-metric-chip:hover {
  transform: translateY(-2px);
}

.buyer-metric-chip.highlight-green {
  border-color: rgba(52, 199, 89, 0.32);
  background: rgba(52, 199, 89, 0.05);
}

.buyer-metric-chip.highlight-blue {
  border-color: rgba(0, 113, 227, 0.32);
  background: rgba(0, 113, 227, 0.05);
}

.bmc-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bmc-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.bmc-note {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Sections */
.buyer-section {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.section-category-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

.buyer-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.buyer-section-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.buyer-section-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 780px;
}

/* Big 4 Buyer Cards */
.buyer-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.35rem;
}

@media (max-width: 820px) {
  .buyer-cards-grid {
    grid-template-columns: 1fr;
  }
}

.buyer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all var(--duration-normal) var(--ease-apple);
}

.buyer-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.buyer-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.buyer-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.buyer-icon-pill.green {
  background: var(--apple-green-subtle);
  color: var(--apple-green);
}

.buyer-icon-pill.blue {
  background: var(--apple-blue-subtle);
  color: var(--apple-blue);
}

.buyer-icon-pill.purple {
  background: var(--apple-purple-subtle);
  color: var(--apple-purple);
}

.buyer-icon-pill.amber {
  background: var(--apple-amber-subtle);
  color: var(--apple-amber);
}











.buyer-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin: 0;
}

.buyer-card-stat {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.buyer-card-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

.buyer-card-text strong {
  color: var(--text-primary);
}

.buyer-card-benefit {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.buyer-card-benefit svg {
  color: var(--apple-green);
  flex-shrink: 0;
  margin-top: 2px;
}

/* 6-Point Inspection Checklist */
.buyer-checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

@media (max-width: 960px) {
  .buyer-checklist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .buyer-checklist-grid {
    grid-template-columns: 1fr;
  }
}

.checklist-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-quick) var(--ease-apple);
}

.checklist-item:hover {
  transform: translateY(-2px);
}

.chk-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--apple-green-subtle);
  color: var(--apple-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chk-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.chk-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chk-content p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}



/* Economics Grid */
.buyer-economics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 820px) {
  .buyer-economics-grid {
    grid-template-columns: 1fr;
  }
}

.economics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-card);
}

.economics-card.highlight-zero {
  border-color: var(--border-subtle);
  background: var(--bg-card);
}

.econ-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.econ-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.econ-badge.badge-green {
  color: var(--apple-green);
  background: var(--apple-green-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.econ-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.econ-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.econ-text {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

.econ-text strong {
  color: var(--text-primary);
}

/* FAQ Stack */
.buyer-faq-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.faq-q {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-a {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* CTA Banner */
.buyer-cta-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

/* ==========================================================================
   Monthly Driven Kilometers Components
   ========================================================================== */
.monthly-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .monthly-stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .monthly-stat-strip {
    grid-template-columns: 1fr;
  }
}

.mss-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-card);
}

.mss-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.mss-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.mss-note {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Monthly KM Cards Grid */
.monthly-km-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 1.15rem;
}

.monthly-km-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-card);
  transition: all var(--duration-quick) var(--ease-apple);
}

.monthly-km-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.mkc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mkc-month {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mkc-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
}

.mkc-tag.tag-blue {
  background: var(--apple-blue-subtle);
  color: var(--apple-blue);
}

.mkc-tag.tag-green {
  background: var(--apple-green-subtle);
  color: var(--apple-green);
}

.mkc-tag.tag-purple {
  background: var(--apple-purple-subtle);
  color: var(--apple-purple);
}

.mkc-tag.tag-amber {
  background: var(--apple-amber-subtle);
  color: var(--apple-amber);
}

.mkc-distance {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.mkc-distance span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.mkc-meter-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.mkc-meter-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--apple-blue);
  transition: width 0.6s var(--ease-apple);
}

.mkc-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
}

/* Detailed Monthly Table */
.monthly-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  margin-top: 0.85rem;
}

.monthly-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.monthly-table th {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.monthly-table td {
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.monthly-table tr:last-child td {
  border-bottom: none;
}

.monthly-table tr:hover td {
  background: var(--bg-subtle);
}

/* ==========================================================================
   Hero Image Carousel & Apple-Style Lightbox
   ========================================================================== */
.hero-carousel-stage {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0D0E12;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1.03);
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.06) saturate(1.1) brightness(1.02);
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.6s var(--ease-apple), filter 0.3s ease;
}

.hero-carousel-stage:hover .carousel-slide.active img,
.buyer-gallery-showcase:hover .carousel-slide.active img {
  transform: scale(1.02);
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.25s var(--ease-apple);
}

.hero-carousel-stage:hover .carousel-nav-btn,
.buyer-gallery-showcase:hover .carousel-nav-btn {
  opacity: 0.92;
}

.carousel-nav-btn:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.08);
}

.carousel-nav-btn.prev {
  left: 1rem;
}

.carousel-nav-btn.next {
  right: 1rem;
}

.carousel-indicators {
  position: absolute;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 10;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.25s var(--ease-apple);
}

.carousel-dot.active {
  width: 24px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.carousel-expand-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.carousel-expand-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

/* Buyer Gallery Showcase Carousel */
.buyer-gallery-showcase {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0B0C0E;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.buyer-gallery-showcase .carousel-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.buyer-gallery-showcase .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(1.1) brightness(1.02);
  image-rendering: -webkit-optimize-contrast;
}

/* Apple Lightbox Modal */
.apple-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 94vw;
  max-width: 1100px;
  height: 90vh;
  max-height: 840px;
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-lightbox.active .lightbox-dialog {
  transform: scale(1);
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.5rem 0.75rem;
}

.lightbox-counter {
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.lightbox-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  filter: contrast(1.06) saturate(1.1) brightness(1.02);
  image-rendering: -webkit-optimize-contrast;
  transition: opacity 0.26s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-image.fade-out {
  opacity: 0;
  transform: scale(0.97);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lightbox-nav-btn.prev {
  left: 1rem;
}

.lightbox-nav-btn.next {
  right: 1rem;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-thumbs {
  display: flex;
  gap: 0.65rem;
  padding: 0.85rem 0 0.25rem;
  overflow-x: auto;
  max-width: 100%;
}

.lightbox-thumb-item {
  width: 68px;
  height: 50px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.45;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox-thumb-item:hover {
  opacity: 0.8;
}

.lightbox-thumb-item.active {
  opacity: 1;
  border-color: var(--apple-blue);
  transform: scale(1.06);
}

.lightbox-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Mobile Bottom Sheet (Log New Event Modal)
   ========================================================================== */
@media (max-width: 680px) {
  #addRecordModal.modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  #addRecordModal .modal-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 42px rgba(0, 0, 0, 0.5);
  }

  #addRecordModal.open .modal-dialog {
    transform: translateY(0);
  }

  #addRecordModal .bottom-sheet-grab-bar {
    display: block;
    width: 36px;
    height: 5px;
    background: var(--border-strong);
    border-radius: 99px;
    margin: 10px auto 2px auto;
    flex-shrink: 0;
    opacity: 0.7;
  }

  #addRecordModal .modal-header {
    padding: 0.85rem 1.25rem 0.85rem 1.25rem;
  }

  #addRecordModal .modal-body {
    padding: 1rem 1.25rem;
    max-height: calc(92dvh - 145px) !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #addRecordModal .modal-footer {
    padding: 0.85rem 1.25rem max(1rem, env(safe-area-inset-bottom, 1rem)) 1.25rem;
  }

  #addRecordModal .form-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  #addRecordModal .event-pill {
    padding: 0.5rem 0.25rem;
    font-size: 0.74rem;
    gap: 4px;
  }

  #addRecordModal .event-pill svg {
    width: 13px;
    height: 13px;
  }

  #addRecordModal .station-pill {
    padding: 0.5rem 0.35rem;
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   Apple Passcode Lock Screen ("6508")
   ========================================================================== */
html.drivoo-unlocked .apple-lock-screen {
  display: none !important;
}

.apple-lock-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-card);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.35s var(--ease-apple), transform 0.35s var(--ease-apple), visibility 0.35s;
  visibility: visible;
  opacity: 1;
}

[data-theme="dark"] .apple-lock-screen {
  background: rgba(14, 15, 18, 0.94);
}

[data-theme="light"] .apple-lock-screen {
  background: rgba(248, 249, 252, 0.94);
}

.apple-lock-screen.unlocked {
  opacity: 0;
  transform: scale(1.04);
  visibility: hidden;
  pointer-events: none;
}

.lock-screen-content {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
}

.lock-icon-wrapper {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--apple-blue-subtle);
  color: var(--apple-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 16px var(--apple-blue-subtle);
  transition: transform 0.3s var(--ease-apple), background-color 0.3s, color 0.3s;
}

.apple-lock-screen.success .lock-icon-wrapper {
  background: var(--apple-green-subtle);
  color: var(--apple-green);
  transform: scale(1.12);
}

.lock-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.lock-subtitle {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.passcode-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 0.75rem;
  transition: transform 0.2s;
}

.passcode-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.passcode-dot.filled {
  background: var(--text-primary);
  border-color: var(--text-primary);
  transform: scale(1.15);
}

.apple-lock-screen.success .passcode-dot.filled {
  background: var(--apple-green);
  border-color: var(--apple-green);
}

.passcode-dots.shake {
  animation: shakePasscode 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakePasscode {
  10%, 90% { transform: translate3d(-4px, 0, 0); }
  20%, 80% { transform: translate3d(6px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
  40%, 60% { transform: translate3d(7px, 0, 0); }
}

.lock-error-msg {
  height: 1.25rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--apple-red);
  margin-bottom: 1.15rem;
  transition: opacity 0.2s;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 14px 22px;
  justify-content: center;
}

.keypad-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s var(--ease-apple);
  font-family: var(--font-system);
  padding: 0;
  box-shadow: var(--shadow-sm);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.keypad-btn span:first-child {
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.1;
}

.keypad-btn .sub {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.keypad-btn:hover {
  background: var(--bg-subtle-hover);
  border-color: var(--border-hover);
}

.keypad-btn:active {
  background: var(--apple-blue);
  color: #FFFFFF;
  border-color: var(--apple-blue);
  transform: scale(0.92);
}

.keypad-btn:active .sub {
  color: rgba(255, 255, 255, 0.75);
}

.keypad-btn.empty {
  visibility: hidden;
  pointer-events: none;
}

.keypad-btn.action {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-secondary);
}

.keypad-btn.action:hover {
  color: var(--text-primary);
}

.keypad-btn.action:active {
  background: transparent;
  color: var(--apple-blue);
  transform: scale(0.9);
}

/* ==========================================================================
   Print Optimization (Dossier Mode)
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .top-nav,
  .nav-actions,
  .btn,
  .filter-switchgear,
  .telemetry-search-box,
  .cockpit-slider,
  .carousel-nav-btn,
  .carousel-indicators,
  .carousel-expand-btn,
  .apple-lightbox {
    display: none !important;
  }
  .dashboard-container {
    padding: 0 !important;
  }
  .apple-card,
  .hero-telemetry-unit,
  .telemetry-card,
  .cockpit-chart-card {
    box-shadow: none !important;
    border: 1px solid #CCCCCC !important;
    break-inside: avoid;
  }
}
