/* FullCircle Custom CSS Design System - Google Play PWA Prototype */

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

:root {
  /* Color system */
  --bg-space: #07060f;
  --bg-deep: #0e0c1b;
  --bg-card: rgba(22, 19, 43, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.15);
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.35);
  
  --accent: #ec4899;
  --accent-hover: #db2777;
  --accent-glow: rgba(236, 72, 153, 0.35);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --safe: #10b981;
  --safe-glow: rgba(16, 185, 129, 0.3);
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  --font-family: 'Outfit', sans-serif;
  --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-space);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.12) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  width: 100%;
  line-height: 1.5;
}

/* ----------------------------------------
   LAYOUT & CONTAINER STRUCTURE
   ---------------------------------------- */

.app-wrapper {
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 30px;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-logo svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.brand-title h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #d8b4fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title p {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 30px;
  padding: 6px 6px 6px 14px;
}

.header-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.header-user-role {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
}

.header-user-role.role-parent {
  background: rgba(16, 185, 129, 0.12);
  color: var(--safe);
}

.btn-sign-out {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-family);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-sign-out:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Switch styling */
.toggle-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: 30px;
}

.toggle-control label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

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

/* ----------------------------------------
   SIMULATOR LAYOUT (DESKTOP SPLIT)
   ---------------------------------------- */

.simulator-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-view-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Constrain viewport on desktop screen widths */
@media (min-width: 480px) {
  .simulator-container {
    max-width: 430px;
    height: 92vh;
    max-height: 900px;
    aspect-ratio: 9 / 18.5;
    border: 10px solid #231f3c; /* Phone Bezel */
    border-radius: 46px; /* Smooth corners */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: #0f0d1a;
    position: relative;
    overflow: hidden;
  }
}

/* ----------------------------------------
   PHONE CONTENT SCREENS & CONTAINERS
   ---------------------------------------- */

.phone-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: #0f0d1a;
  background-image: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
  overflow: hidden;
}

.phone-screen > div:not(.wallet-modal) {
  height: 100%;
  max-height: 100%;
  padding: 34px 20px 20px;
  box-sizing: border-box;
}

.screen-header {
  margin: 10px 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.screen-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.profile-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: rgba(139, 92, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.select-input-wrapper {
  position: relative;
}

.select-input-wrapper select {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.select-input-wrapper select:focus {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.05);
}

.select-input-wrapper::after {
  content: '▼';
  font-size: 9px;
  color: var(--text-muted);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Circles select capsule picker */
.circle-picker-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.circle-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.circle-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--safe);
}

.circle-info h4 {
  font-size: 13px;
  font-weight: 700;
}

.circle-info p {
  font-size: 10px;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-family);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--safe-glow);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-sos {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ----------------------------------------
   STATE-SPECIFIC MOBILE VIEWS
   ---------------------------------------- */

/* Idle / Estimates banner */
.estimates-banner {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Broadcasting / Waiting Screen */
.broadcast-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  text-align: center;
  padding: 20px;
}

.radar-container {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.25);
  animation: radarPulse 3s infinite linear;
}

.radar-pulse:nth-child(2) {
  animation-delay: 1s;
}

.radar-pulse:nth-child(3) {
  animation-delay: 2s;
}

.radar-center {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 25px var(--primary-glow);
}

.radar-center svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  animation: spin 6s infinite linear;
}

.broadcast-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.broadcast-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.location-preview-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* ----------------------------------------
   MAP WRAPPER ELEMENTS
   ---------------------------------------- */

.map-viewport {
  width: 100%;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: #0c0a18;
  position: relative;
  margin-bottom: 16px;
}

/* Leaflet map div and legacy SVG both fill the viewport */
.map-viewport svg,
.map-viewport > div[id^="map-"] {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.map-overlay-eta {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 13, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
}

.map-overlay-eta span.pulsing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

/* Live tracking card footer details */
.tracking-status-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.driver-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.driver-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.driver-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.driver-info h4 {
  font-size: 14px;
  font-weight: 700;
}

.driver-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.vehicle-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Tracking progress bar */
.tracking-progress-bar {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 10px 0 14px;
}

.tracking-bar-fill {
  height: 100%;
  width: 8%; /* start value */
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--primary-glow);
}

/* ----------------------------------------
   PARENT APPS MOCK VIEWS
   ---------------------------------------- */

.parent-dashboard-home {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  gap: 16px;
  padding-bottom: 80px;
}


.parent-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0 20px;
}

.stat-item-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}

.stat-item-box h5 {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-item-box p.val {
  font-size: 20px;
  font-weight: 800;
}

.stat-item-box.premium-border {
  border-color: rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.02);
}

.premium-pill {
  font-size: 9px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 4px;
}

/* Incoming broadcast ride request ringing card overlay */
.ringing-overlay-request {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  text-align: center;
  padding: 10px 0;
  animation: fadeInUp 0.5s ease-out;
}

.ringing-header {
  margin-top: 15px;
}

.ringing-header h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  animation: pulseColor 2s infinite ease-in-out;
}

.ringing-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.ringing-card-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.ringing-route-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-bottom: 20px;
}

.route-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.route-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.route-step-dot.end {
  background: var(--accent);
}

.route-step-text h5 {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.route-step-text p {
  font-size: 14px;
  font-weight: 700;
}

.ringing-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 15px;
}

.ring-stat h6 {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ring-stat p {
  font-size: 16px;
  font-weight: 800;
}

.ringing-actions-row {
  display: flex;
  gap: 12px;
}

/* ----------------------------------------
   COMPLETED / SUMMARY SCREENS
   ---------------------------------------- */

.completed-view {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  text-align: center;
  padding: 15px 0;
}

.success-badge-container {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--safe);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 16px;
  box-shadow: 0 0 20px var(--safe-glow);
}

.success-badge-container svg {
  width: 32px;
  height: 32px;
  fill: var(--safe);
}

.completed-view h3 {
  font-size: 20px;
  font-weight: 800;
}

.completed-view p.msg {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.summary-logs-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: left;
  margin-bottom: 24px;
}

.summary-logs-card h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.log-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
}

.log-row span.label {
  color: var(--text-muted);
}

.log-row span.val {
  font-weight: 700;
}

/* ----------------------------------------
   PREMIUM FAIL-SAFE BACKUP SCREEN
   ---------------------------------------- */

.failsafe-view {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.failsafe-header {
  text-align: center;
  margin-top: 15px;
}

.failsafe-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--warning);
}

.failsafe-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.failsafe-timeout-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 12px;
  font-weight: 500;
  padding: 10px;
  border-radius: var(--radius-md);
  margin: 12px auto;
  text-align: center;
  max-width: 90%;
  line-height: 1.4;
}

.failsafe-body {
  margin: 20px 0;
}

.failsafe-option-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.failsafe-option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.03);
}

.failsafe-opt-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.failsafe-opt-text h4 {
  font-size: 14px;
  font-weight: 700;
}

.failsafe-opt-text p {
  font-size: 11px;
  color: var(--text-muted);
}

.failsafe-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
}

.failsafe-suggestion-bullet {
  font-size: 18px;
  flex-shrink: 0;
}

/* Persistent driver missed alert modal */
.parent-missed-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 10, 24, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px 20px;
  text-align: center;
  box-sizing: border-box;
}

.parent-missed-modal.hidden {
  display: none !important;
}

.parent-missed-modal h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--warning);
  margin-top: 10px;
}

.parent-missed-modal p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

.parent-missed-modal-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 24px 0;
  text-align: left;
  box-sizing: border-box;
}

.parent-missed-modal-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.parent-missed-modal-card strong {
  color: #fff;
  font-size: 14px;
}

/* ----------------------------------------
   EMERGENCY CRASH / MANUAL SOS OVERLAY
   ---------------------------------------- */

.emergency-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 10, 24, 0.95);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 24px 30px;
  animation: fadeIn 0.3s ease-out;
}

.emergency-banner-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  animation: pulseGlowDanger 1.5s infinite ease-in-out;
}

.emergency-banner-alert svg {
  width: 40px;
  height: 40px;
  fill: var(--danger);
  margin-bottom: 12px;
}

.emergency-banner-alert h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
  letter-spacing: -0.5px;
}

.emergency-banner-alert p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.emergency-status-list {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.emergency-status-list h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.status-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.status-step-row svg {
  width: 16px;
  height: 16px;
  fill: var(--safe);
}

.status-step-row span {
  font-weight: 600;
}

.status-step-row span.pending {
  color: var(--text-muted);
}

.status-step-row svg.pending-icon {
  fill: var(--text-muted);
  opacity: 0.4;
}

/* ----------------------------------------
   SANDBOX CONTROL PANEL (BOTTOM DISPLAY)
   ---------------------------------------- */

.sandbox-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-premium);
  margin-bottom: 30px;
}

.sandbox-panel h2 {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.sandbox-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
}

.sandbox-controls-col h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.sandbox-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sandbox-btn {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sandbox-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
}

.sandbox-btn.active-btn {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
  color: #d8b4fe;
}

/* Premium Telematics Graphing card */
.telematics-dashboard {
  opacity: 1;
  transition: opacity 0.3s;
}

.telematics-dashboard.disabled {
  opacity: 0.25;
  pointer-events: none;
}

.telematics-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.chart-wrapper {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 10px;
  height: 110px;
  position: relative;
}

.chart-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.telematics-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.telematics-stats-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.telematics-stat {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: 8px;
  font-size: 10px;
}

.telematics-stat span.lbl {
  color: var(--text-muted);
  display: block;
}

.telematics-stat span.v {
  font-size: 13px;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

/* ----------------------------------------
   SINGLE SCREEN RESPONSIVE STYLING (TWA / PWA)
   ---------------------------------------- */

.mobile-selector-header {
  background: rgba(22, 19, 43, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
  padding: 10px 16px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-selector-header label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.mobile-selector-header select {
  background: #0f0d1a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 12px;
  outline: none;
}

/* Toast alert popup notification */
.toast-alert {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 50px);
  background: rgba(14, 12, 27, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  white-space: nowrap;
}

.toast-alert.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Helper Class Utilities */
.hidden {
  display: none !important;
}
.h-full {
  height: 100%;
}

/* ----------------------------------------
   KEYFRAMES KEY-ANIMATIONS
   ---------------------------------------- */

@keyframes radarPulse {
  0% {
    transform: scale(0.35);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.1);
    opacity: 0;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

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

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes pulseGlowDanger {
  0%, 100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
  }
  50% {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 1.0);
  }
}

@keyframes pulseColor {
  0%, 100% { color: var(--accent); }
  50% { color: var(--primary); }
}

/* Height-based Scaling for Desktop Simulator Mockups */
@media (min-width: 900px) and (max-height: 900px) {
  .device-wrapper {
    max-width: 340px;
  }
}
@media (min-width: 900px) and (max-height: 800px) {
  .device-wrapper {
    max-width: 300px;
  }
}
@media (min-width: 900px) and (max-height: 700px) {
  .device-wrapper {
    max-width: 260px;
  }
}

/* Responsive Map Heights on Shorter Screens */
@media (max-height: 800px) {
  .map-viewport {
    height: 180px;
  }
}
@media (max-height: 700px) {
  .map-viewport {
    height: 140px;
  }
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .app-wrapper {
    padding: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }
  
  header.app-header, .sandbox-panel {
    display: none !important; /* Hide workbench headers/sandbox on small screens */
  }

  .simulator-container {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
    padding-top: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .device-wrapper {
    max-width: 100%;
    margin: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .device-frame {
    border: none;
    border-radius: 0;
    aspect-ratio: auto;
    height: 100%;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
  }

  .device-label, .camera-cutout, .navigation-pill {
    display: none !important;
  }

  .mobile-selector-header {
    display: flex !important;
    background: rgba(14, 12, 27, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: calc(44px + env(safe-area-inset-top, 12px));
    padding: env(safe-area-inset-top, 12px) 16px 12px;
    box-sizing: border-box;
  }

  .status-bar {
    display: none !important;
  }

  .phone-screen {
    padding: 0;
    height: 100%;
    overflow: hidden;
  }

  .phone-screen > div:not(.wallet-modal) {
    padding: calc(12px + env(safe-area-inset-top, 12px)) 20px calc(12px + env(safe-area-inset-bottom, 12px));
    box-sizing: border-box;
  }

  .mobile-selector-header:not(.hidden) ~ .app-wrapper .phone-screen > div:not(.wallet-modal) {
    padding-top: calc(56px + env(safe-area-inset-top, 12px));
  }

  .parent-dashboard-home,
  #kid-screen-idle,
  #parent-screen-request-idle {
    padding-bottom: 120px;
  }

  .wallet-modal {
    top: 0;
    height: 100%;
  }

  .mobile-selector-header:not(.hidden) ~ .app-wrapper .wallet-modal {
    top: calc(44px + env(safe-area-inset-top, 12px));
    height: calc(100% - (44px + env(safe-area-inset-top, 12px)));
  }
}

/* ----------------------------------------
   KIDKOINS PREMIUM CORE MODULE STYLING
   ---------------------------------------- */

.kk-badge {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
  transition: all 0.2s ease;
}

.kk-badge:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #fbbf24;
  transform: translateY(-1px);
}

.wallet-modal {
  position: absolute;
  top: 34px; /* positioned below device status-bar */
  left: 0;
  width: 100%;
  height: calc(100% - 34px);
  background: rgba(14, 12, 27, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 20px;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.wallet-header h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.btn-close-modal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: background 0.2s;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.12);
}

.wallet-balance-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wallet-balance-card span.lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
}

.wallet-balance-card span.val {
  font-size: 30px;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  margin-top: 2px;
  display: block;
}

.wallet-history h4 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 220px;
  padding-right: 4px;
}

.ledger-list::-webkit-scrollbar {
  width: 4px;
}
.ledger-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.ledger-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.ledger-desc h5 {
  font-weight: 600;
}

.ledger-desc p {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.ledger-amount {
  font-weight: 800;
}

.ledger-amount.credit {
  color: var(--safe);
}

.ledger-amount.debit {
  color: var(--danger);
}

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

/* ============================================================
   AUTH OVERLAY — Login / Sign-Up Screen
   ============================================================ */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--bg-space);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 45%);
  animation: fadeIn 0.4s ease-out;
}

.auth-overlay.hidden {
  display: none;
}

.auth-overlay-out {
  animation: fadeOut 0.5s ease-out forwards;
}

.auth-card {
  background: rgba(20, 17, 40, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: slideUpCard 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Brand header inside auth card */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.auth-brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
  flex-shrink: 0;
}

.auth-brand-logo svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.auth-brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #d8b4fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.auth-brand-tagline {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Tab switcher */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Error banner */
.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #f87171;
  margin-bottom: 16px;
  font-weight: 500;
}

.auth-error.success-alert {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* Form fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"] {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.auth-field input:focus {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.05);
}

.auth-submit-btn {
  margin-top: 6px;
  padding: 15px;
  font-size: 15px;
}

/* Role picker cards */
.auth-role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-role-option {
  cursor: pointer;
}

.auth-role-option input[type="radio"] {
  display: none;
}

.auth-role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.auth-role-card.selected {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 15px var(--primary-glow);
}

.auth-role-emoji {
  font-size: 26px;
}

.auth-role-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.auth-role-option.role-disabled {
  cursor: not-allowed;
}

.auth-role-card.card-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.1);
}

.auth-role-card.card-disabled:hover {
  border-color: rgba(255, 255, 255, 0.04) !important;
  background: rgba(0, 0, 0, 0.1) !important;
  box-shadow: none !important;
}

.auth-invite-notice {
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
  margin-top: 8px;
  box-sizing: border-box;
}

.auth-invite-notice strong {
  color: #fbbf24;
}

/* Circle setup section */
.auth-divider {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-circle-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

/* ============================================================
   LOCATION PICKER BUTTON (replaces old select dropdown)
   ============================================================ */
.location-picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border-glass);
  border-radius: 14px;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.location-picker-btn:hover, .location-picker-btn:focus {
  border-color: var(--primary);
  background: rgba(139,92,246,0.08);
  color: var(--text-main);
  outline: none;
}
.location-picker-btn.has-value { color: var(--text-main); border-color: rgba(139,92,246,0.4); }
.location-picker-btn .lp-icon { width: 16px; height: 16px; flex-shrink: 0; fill: var(--primary); }
.location-picker-btn .lp-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-picker-btn .lp-chevron { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   SAVE AS FAVOURITE BANNER
   ============================================================ */
.save-place-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px;
  font-size: 11px; color: var(--warning); margin-top: 6px;
}
.save-place-actions { display: flex; gap: 6px; }
.save-place-actions button {
  padding: 4px 10px; border-radius: 8px; border: 1px solid var(--warning);
  background: transparent; color: var(--warning); font-size: 11px;
  font-family: var(--font-family); cursor: pointer; transition: all 0.15s;
}
.save-place-actions button:hover { background: var(--warning); color: #000; }

/* ============================================================
   LOCATION PICKER MODAL
   ============================================================ */
.lp-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(7,6,15,0.85);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(6px);
}
.lp-modal.hidden { display: none; }
.lp-modal-card {
  background: #12102a;
  border: 1px solid var(--border-glass);
  border-radius: 24px 24px 0 0;
  width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  padding: 24px 20px 32px;
  display: flex; flex-direction: column; gap: 14px;
  animation: slideUpCard 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.lp-modal-header { display: flex; align-items: center; justify-content: space-between; }
.lp-modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text-main); margin: 0; }
.lp-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-glass); background: rgba(255,255,255,0.05);
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.lp-close-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.lp-my-location-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(236,72,153,0.1));
  border: 1.5px solid rgba(139,92,246,0.35);
  border-radius: 14px; color: var(--primary);
  font-family: var(--font-family); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-align: left; width: 100%;
}
.lp-my-location-btn svg { width: 18px; height: 18px; flex-shrink: 0; fill: var(--primary); }
.lp-my-location-btn:hover { background: rgba(139,92,246,0.25); transform: translateY(-1px); }
.lp-my-location-btn:disabled { opacity: 0.6; transform: none; cursor: wait; }

.lp-search-wrapper {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border-glass); border-radius: 12px; transition: border-color 0.2s;
}
.lp-search-wrapper:focus-within { border-color: var(--primary); }
.lp-search-wrapper svg { width: 16px; height: 16px; flex-shrink: 0; stroke: var(--text-muted); fill: none; }
.lp-search-wrapper input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-main); font-family: var(--font-family); font-size: 13px;
}
.lp-search-wrapper input::placeholder { color: var(--text-muted); }

.lp-results-list { display: flex; flex-direction: column; gap: 2px; }
.lp-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; border: none;
  background: transparent; cursor: pointer; width: 100%;
  text-align: left; transition: background 0.15s;
}
.lp-result-item:hover { background: rgba(139,92,246,0.1); }
.lp-result-icon { font-size: 18px; flex-shrink: 0; }
.lp-result-text { display: flex; flex-direction: column; gap: 1px; overflow: hidden; min-width: 0; }
.lp-result-name { font-size: 13px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-result-addr { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-loading, .lp-no-results { font-size: 12px; color: var(--text-muted); padding: 8px 12px; }
.lp-section-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 2px;
}
.lp-manage-link {
  background: none; border: none; color: var(--primary);
  font-size: 11px; font-family: var(--font-family); cursor: pointer; padding: 0; font-weight: 600;
}
.lp-empty-hint { font-size: 12px; color: var(--text-muted); padding: 8px 4px; }

/* ============================================================
   MANAGE PLACES MODAL
   ============================================================ */
.manage-add-form {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass); border-radius: 14px;
}
.manage-add-form input {
  padding: 10px 12px;
  background: rgba(255,255,255,0.05); border: 1.5px solid var(--border-glass);
  border-radius: 10px; color: var(--text-main); font-family: var(--font-family);
  font-size: 13px; outline: none; transition: border-color 0.2s;
}
.manage-add-form input:focus { border-color: var(--primary); }
.manage-add-form input::placeholder { color: var(--text-muted); }
.manage-places-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.manage-place-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass); border-radius: 10px;
}
.manage-place-info { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.manage-place-name { font-size: 13px; font-weight: 600; color: var(--text-main); }
.manage-place-addr { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manage-place-delete {
  background: none; border: none; font-size: 18px; cursor: pointer;
  padding: 4px; border-radius: 6px; transition: background 0.15s; flex-shrink: 0;
}
.manage-place-delete:hover { background: rgba(239,68,68,0.15); }

/* Circle Members List */
.circle-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.circle-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.circle-member-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}
.circle-member-avatar {
  font-size: 20px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.circle-member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.circle-member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.circle-member-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.circle-member-you-badge {
  font-size: 9px;
  color: var(--primary);
  background: rgba(139, 92, 246, 0.15);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.circle-member-role {
  font-size: 10px;
  color: var(--text-muted);
}
.circle-member-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}
.circle-member-badge.role-parent {
  background: rgba(236, 72, 153, 0.1);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.2);
}
.circle-member-badge.role-teen {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============================================================
   LEAFLET MAP — Custom Markers & Dark Theme Overrides
   ============================================================ */
/* Leaflet dark theme overrides (zoom controls, attribution) */
.lf-driver-marker {
  position: relative; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.lf-driver-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(139,92,246,0.3);
  animation: driverPulse 1.8s ease-out infinite;
}
.lf-driver-car {
  font-size: 26px; position: relative; z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}
@keyframes driverPulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2); opacity: 0; }
}

.lf-pin { width: 32px; height: 42px; display: flex; align-items: flex-start; justify-content: center; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5)); }
.lf-pin svg { width: 32px; height: 42px; }
.lf-pin-pickup svg  { fill: var(--safe); }
.lf-pin-dropoff svg { fill: var(--accent); }

.leaflet-control-attribution { display: none !important; }
.leaflet-control-zoom a { background: rgba(18,16,42,0.92) !important; color: var(--text-main) !important; border-color: var(--border-glass) !important; }
.leaflet-popup-content-wrapper { background: #12102a !important; border: 1px solid var(--border-glass) !important; color: var(--text-main) !important; border-radius: 10px !important; }
.leaflet-popup-tip { background: #12102a !important; }

/* Profile Custom Avatar grid styling */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.avatar-select-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 22px;
  padding: 8px 0;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-select-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
  transform: scale(1.05);
}

.avatar-select-btn.selected {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Premium Subscription Badge Button in Header */
.premium-status-btn {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.premium-status-btn.upgrade-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.premium-status-btn.upgrade-btn:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
  transform: scale(1.03);
}

.premium-status-btn.active-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
  animation: pulseActivePremium 2.5s infinite;
}

.premium-status-btn.active-btn:hover {
  box-shadow: 0 0 22px rgba(236, 72, 153, 0.6);
  transform: scale(1.03);
}

@keyframes pulseActivePremium {
  0% { box-shadow: 0 0 12px var(--primary-glow); }
  50% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.45); }
  100% { box-shadow: 0 0 12px var(--primary-glow); }
}

/* Spinner loading inside checkout submit button */
.spinner-loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin-loading 0.8s infinite linear;
}

@keyframes spin-loading {
  to { transform: rotate(360deg); }
}

/* Locked styling for premium score metric cards */
.stat-item-box.premium-border.disabled {
  border-color: rgba(255, 255, 255, 0.05) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  opacity: 0.5;
}

/* Premium Upgrade Promo Banner inside phone simulator screens */
.premium-promo-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.premium-promo-card:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.12) 100%);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.premium-promo-card span {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.premium-promo-card p {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* PWA Update Banner */
.pwa-update-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(22, 19, 43, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(100% - 48px);
  max-width: 360px;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.pwa-update-banner.hidden {
  display: none !important;
}

.pwa-update-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pwa-update-icon {
  font-size: 24px;
}

.pwa-update-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.pwa-update-text p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pwa-update-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  width: auto;
  border-radius: 8px;
}

/* Add an update trigger in edit profile pages too */
.update-status-row {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.update-status-row span {
  font-size: 11px;
  color: var(--text-muted);
}
.update-status-row button {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s;
}
.update-status-row button:hover {
  background: var(--primary);
  color: #fff;
}

/* Scrollable scheduled rides list and screen idle adjustments */
#parent-scheduled-rides-list,
#kid-scheduled-rides-list {
  max-height: 125px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#parent-scheduled-rides-list::-webkit-scrollbar,
#kid-scheduled-rides-list::-webkit-scrollbar,
.parent-dashboard-home::-webkit-scrollbar,
#kid-screen-idle::-webkit-scrollbar,
#parent-screen-request-idle::-webkit-scrollbar {
  width: 4px;
}

#parent-scheduled-rides-list::-webkit-scrollbar-track,
#kid-scheduled-rides-list::-webkit-scrollbar-track,
.parent-dashboard-home::-webkit-scrollbar-track,
#kid-screen-idle::-webkit-scrollbar-track,
#parent-screen-request-idle::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

#parent-scheduled-rides-list::-webkit-scrollbar-thumb,
#kid-scheduled-rides-list::-webkit-scrollbar-thumb,
.parent-dashboard-home::-webkit-scrollbar-thumb,
#kid-screen-idle::-webkit-scrollbar-thumb,
#parent-screen-request-idle::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

#kid-screen-idle,
#parent-screen-request-idle {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  gap: 12px;
  padding-bottom: 20px;
}

/* ============================================================
   DEVELOPER DASHBOARD & AUTH CARD RESPONSIVE STYLING
   ============================================================ */
.dev-modal-card {
  border-radius: 24px !important;
  width: 95vw !important;
  max-width: 1000px !important;
  max-height: 90vh !important;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: rgba(10, 8, 22, 0.96);
  border: 1.5px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: scaleUpCard 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  gap: 0;
}

.dev-dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 16px;
  min-height: 0;
}

.dev-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .dev-modal-card {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 16px;
    border: none !important;
  }
  
  .dev-dashboard-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .dev-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .auth-card {
    padding: 20px !important;
  }
}

/* ============================================================
   PWA STANDALONE INSTALLED APP STYLING
   ============================================================ */
.pwa-standalone,
.pwa-standalone body {
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

.pwa-standalone .app-wrapper {
  padding: 0 !important;
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

.pwa-standalone header.app-header,
.pwa-standalone .sandbox-panel {
  display: none !important;
}

.pwa-standalone .simulator-container {
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

.pwa-standalone .device-wrapper {
  max-width: 100% !important;
  margin: 0 !important;
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

.pwa-standalone .device-frame {
  border: none !important;
  border-radius: 0 !important;
  aspect-ratio: auto !important;
  height: 100% !important;
  height: 100dvh !important;
  width: 100vw !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

.pwa-standalone .device-label,
.pwa-standalone .camera-cutout,
.pwa-standalone .navigation-pill,
.pwa-standalone .status-bar,
.pwa-standalone .mobile-selector-header {
  display: none !important;
}

.pwa-standalone .phone-screen {
  padding: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.pwa-standalone .phone-screen > div:not(.wallet-modal) {
  padding: calc(12px + env(safe-area-inset-top, 12px)) 20px calc(12px + env(safe-area-inset-bottom, 12px)) !important;
  box-sizing: border-box !important;
}

.pwa-standalone .wallet-modal {
  top: 0 !important;
  height: 100% !important;
  padding: calc(20px + env(safe-area-inset-top, 12px)) 20px calc(20px + env(safe-area-inset-bottom, 12px)) !important;
}

/* PWA Installation Tip Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  background: rgba(14, 12, 27, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-premium);
  z-index: 9998;
  animation: slideUpInstall 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 500px;
}

@media (min-width: 768px) {
  .pwa-install-banner {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    --translate-x-init: -50%;
  }
}

@keyframes slideUpInstall {
  from {
    transform: translateY(120%) translateX(var(--translate-x-init, 0));
    opacity: 0;
  }
  to {
    transform: translateY(0) translateX(var(--translate-x-init, 0));
    opacity: 1;
  }
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.pwa-install-icon {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.15);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.pwa-install-text h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.pwa-install-text p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-close-banner {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-close-banner:hover {
  color: #fff;
}


