:root {
  /* Основная палитра (Premium) */
  --blue: #1A56DB; 
  --blue-hover: #1E40AF;
  --blue-light: #EFF6FF; 
  --blue-mid: #DBEAFE; 
  --blue-dark: #1E3A8A;
  
  --green: #10B981; 
  --green-light: #ECFDF5; 
  --green-mid: #6EE7B7;
  
  --red: #EF4444; 
  --red-light: #FEF2F2;
  
  --amber: #F59E0B;
  
  /* Текст, фоны, границы */
  --text: #111827; 
  --text-secondary: #4B5563;
  --muted: #9CA3AF;
  
  --bg: #F3F4F6; /* Мягкий серый фон для контраста с белыми карточками */
  --card: #FFFFFF;
  --input-bg: #F9FAFB;
  --border: #E5E7EB; 
  --border-light: #F3F4F6;
  
  /* Совместимость со старыми переменными из HTML */
  --ink: #111827;
  --cream: #111827;
  --amber-dark: #D97706;
  --road: #F3F4F6; 
  --road2: #FFFFFF; 
  --card-bg: #FFFFFF;
  --glass: rgba(0, 0, 0, 0.03); 
  --glass2: rgba(26, 86, 219, 0.08);
  --success: #10B981; 
  --danger: #EF4444;

  /* Многослойные тени (Apple-style) */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-blue: 0 8px 20px -4px rgba(26, 86, 219, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { 
  font-family: 'Inter', system-ui, -apple-system, sans-serif; 
  background: var(--bg); 
  color: var(--text); 
  min-height: 100dvh; 
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.screen { display: none; position: relative; z-index: 1; }
.screen.active { display: block; }

/* ================= AUTH ================= */
.auth-wrap { min-height: 100dvh; display: flex; align-items: stretch; justify-content: center; padding: env(safe-area-inset-top) 0 0; background: var(--card); }
.auth-box { width: 100%; max-width: 440px; min-height: 100dvh; display: flex; flex-direction: column; background: var(--card); }
.auth-logo { font-family: 'Inter', sans-serif; font-size: 2.2rem; font-weight: 900; letter-spacing: -0.04em; color: var(--blue); text-align: center; margin-bottom: 4px; }
.auth-logo span { color: var(--text); }
.auth-tagline { text-align: center; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0; }
.auth-card { background: var(--card); border: none; border-radius: 0; padding: 32px 24px 40px; }

.role-select { display: flex; gap: 8px; margin-bottom: 20px; background: var(--input-bg); padding: 6px; border-radius: 20px; border: 1px solid var(--border); }
.role-btn { flex: 1; padding: 14px 10px; border-radius: 14px; border: none; background: transparent; color: var(--muted); font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.2s; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.role-btn .role-icon { font-size: 1.5rem; }
.role-btn.active { background: var(--card); color: var(--blue); box-shadow: var(--shadow-sm); }

.auth-tabs { display: flex; background: var(--input-bg); border-radius: 20px; padding: 6px; margin-bottom: 20px; border: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 12px; border-radius: 14px; border: none; background: transparent; font-family: 'Inter', sans-serif; font-size: 0.88rem; font-weight: 700; color: var(--muted); cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

/* ================= FORMS ================= */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 8px; font-family: 'Inter', sans-serif; }
input, select, textarea { width: 100%; background: var(--input-bg); border: 1.5px solid transparent; border-radius: 16px; padding: 16px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 1rem; transition: all 0.2s ease; outline: none; box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { background: var(--card); border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-light); }
input[type=password] { letter-spacing: 0.1em; }
select option { background: var(--card); color: var(--text); }
textarea { resize: vertical; min-height: 80px; }
.input-row { display: flex; gap: 12px; }
.input-row .form-group { flex: 1; }
.input-hint { font-size: 0.7rem; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 0.7rem; color: var(--danger); margin-top: 6px; display: none; }
.field-error.show { display: block; }
input.err, select.err { box-shadow: 0 0 0 2px var(--danger) !important; background: var(--red-light); }
input.ok, select.ok { box-shadow: 0 0 0 2px var(--green-mid) !important; }

/* ================= BUTTONS ================= */
.btn { width: 100%; padding: 16px; border-radius: 16px; border: none; font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 4px 12px -2px rgba(26, 86, 219, 0.4); }
.btn-outline { background: var(--card); border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--input-bg); border-color: var(--muted); }
.btn-danger { background: var(--red); color: #fff; font-weight: 700; box-shadow: 0 4px 12px -2px rgba(239,68,68,0.35); }
.btn-danger:hover { background: #DC2626; box-shadow: 0 4px 16px -2px rgba(239,68,68,0.45); }
.btn-sm { padding: 10px 16px; border-radius: 12px; font-size: 0.85rem; width: auto; }
.btn-link { background: none; border: none; color: var(--blue); font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 0; text-decoration: none; }

/* ================= WIZARDS (REGISTRATION) ================= */
.dreg-wrap { min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding: env(safe-area-inset-top) 0 0; background: var(--card); }
.dreg-box { width: 100%; max-width: 680px; }
.dreg-header { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dreg-back { background: var(--input-bg); border: none; border-radius: 12px; color: var(--text-secondary); font-size: 0.9rem; cursor: pointer; padding: 10px 16px; transition: all 0.2s; font-family: 'Inter', sans-serif; font-weight: 700; }
.dreg-back:hover { background: var(--border); color: var(--text); }
.dreg-logo { font-family: 'Inter', sans-serif; font-size: 1.4rem; font-weight: 900; letter-spacing: -0.03em; color: var(--blue); }
.dreg-logo span { color: var(--text); }

.dreg-progress { padding: 24px 20px 0; }
.dreg-steps { display: flex; align-items: center; gap: 0; margin-bottom: 12px; }
.dreg-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.dreg-step-circle { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800; color: var(--muted); transition: all 0.35s; position: relative; z-index: 1; }
.dreg-step.done .dreg-step-circle { background: var(--green); border-color: var(--green); color: #fff; }
.dreg-step.active .dreg-step-circle { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px var(--blue-light); }
.dreg-step-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-top: 8px; text-align: center; }
.dreg-step.active .dreg-step-label { color: var(--blue); }
.dreg-step.done .dreg-step-label { color: var(--green); }
.dreg-step-line { flex: 1; height: 3px; background: var(--border); margin: 0 4px; margin-bottom: 22px; transition: background 0.35s; border-radius: 2px; }
.dreg-step-line.done { background: var(--green); }
.dreg-step-line.active { background: linear-gradient(90deg, var(--green), var(--blue)); }

.dreg-panel { display: none; animation: stepIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1); }
.dreg-panel.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.dreg-card { background: var(--card); border: none; border-radius: 0; padding: 24px 20px; margin-bottom: 0; }
.dreg-section-title { font-family: 'Inter', sans-serif; font-size: 1.3rem; font-weight: 900; letter-spacing: -0.02em; color: var(--text); margin-bottom: 6px; }
.dreg-section-sub { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.4; }

/* Color Picker */
.dreg-color-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 12px 0 16px; }
.dreg-color-tile { aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.dreg-color-tile:hover { transform: scale(1.1); z-index: 2; box-shadow: var(--shadow-sm); }
.dreg-color-tile.active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light), var(--shadow-md); }
.dreg-color-tile .check { display: none; font-size: 1rem; }
.dreg-color-tile.active .check { display: block; }
.dreg-color-name { text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--blue); margin-top: -4px; margin-bottom: 16px; min-height: 18px; }

/* Photo Upload */
.dreg-photo-zone { border: 2px dashed var(--border); background: var(--input-bg); border-radius: 20px; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: pointer; transition: all 0.25s; position: relative; overflow: hidden; }
.dreg-photo-zone:hover { border-color: var(--blue); background: var(--blue-light); }
.dreg-photo-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dreg-photo-zone img.dreg-photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.dreg-photo-zone-content { display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1; pointer-events: none; }
.dreg-photo-zone-icon { font-size: 2.5rem; }
.dreg-photo-zone-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.dreg-photo-zone-sub { font-size: 0.8rem; color: var(--text-secondary); text-align: center; }
.dreg-photo-zone.has-photo .dreg-photo-zone-content { opacity: 0; }
.dreg-photo-change { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; padding: 6px 14px; font-size: 0.75rem; font-weight: 700; color: #fff; cursor: pointer; z-index: 2; display: none; }
.dreg-photo-zone.has-photo .dreg-photo-change { display: block; }

.dreg-nav { display: flex; gap: 12px; margin-top: 12px; }
.dreg-nav .btn { flex: 1; }

.dreg-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.dreg-summary-item { background: var(--input-bg); border-radius: 16px; padding: 14px; border: 1px solid var(--border); }
.dreg-summary-item-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.dreg-summary-item-val { font-size: 0.95rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }

.dreg-car-preview-summary { border-radius: 16px; overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.dreg-car-preview-summary img { width: 100%; height: 160px; object-fit: cover; }

.agree-row { display: flex; align-items: flex-start; gap: 12px; font-size: 0.8rem; color: var(--text-secondary); margin-top: 16px; line-height: 1.5; }
.agree-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.agree-row a { color: var(--blue); text-decoration: none; font-weight: 600; }

.preg-req { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; transition: color 0.2s; }
.preg-req:last-child { margin-bottom: 0; }
.preg-req.ok { color: var(--green); font-weight: 600; }
.preq-icon { font-size: 0.85rem; width: 16px; text-align: center; }

/* ================= MAIN APP ================= */
.app { max-width: 480px; margin: 0 auto; padding: 0 0 80px; background-color: var(--bg); min-height: 100dvh; }
@media(min-width: 800px) {
  .app { box-shadow: 0 0 50px rgba(0,0,0,0.1); border-radius: 0; }
}

header { display: flex; flex-direction: column; background: var(--card); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm); padding-top: env(safe-area-inset-top); }
.header-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.user-pill { display: flex; align-items: center; gap: 12px; background: transparent; border: none; cursor: pointer; transition: opacity 0.2s; flex: 1; min-width: 0; }
.user-pill:active { opacity: 0.7; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; overflow: hidden; border: 2px solid var(--border); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-pill-name { font-size: 0.95rem; font-weight: 800; color: var(--text); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill-role { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; }

.main { display: flex; flex-direction: column; gap: 0; padding: 16px; min-height: calc(100dvh - 80px); }
#driverView { min-height: calc(100dvh - 80px); }
#passengerView { min-height: calc(100dvh - 80px); }
.left-col { width: 100%; }

/* ================= CARDS ================= */
.card, .car-stage, .driver-card { background: var(--card); border: 1px solid rgba(0,0,0,0.02); border-radius: 24px; padding: 20px; box-shadow: var(--shadow-md); margin-bottom: 16px; transition: transform 0.2s ease, box-shadow 0.2s ease; position: relative; }
.card-title { font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; color: var(--muted); text-transform: uppercase; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* Car Stage */
.car-stage::before { display: none; }
.car-stage-title { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 800; color: var(--text); text-align: center; width: 100%; margin-top: 4px; }
.car-stage-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: -2px; display: flex; align-items: center; gap: 8px; justify-content: center; font-weight: 500; }
#carSvgWrap { position: relative; display: inline-block; z-index: 1; margin: 10px auto; width: 100%; }
.cabin-legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; z-index: 1; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); }
.legend-dot { width: 12px; height: 12px; border-radius: 4px; border: 2px solid; }

/* Driver Cards */
.driver-card { overflow: hidden; cursor: pointer; padding: 16px; }
.driver-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.driver-card:active { transform: scale(0.98); }
.driver-card.active-driver { box-shadow: 0 0 0 2px var(--blue), var(--shadow-blue); }
.driver-card.booked-driver { box-shadow: 0 0 0 2px var(--green), 0 4px 16px rgba(16, 185, 129, 0.2); }
.driver-thumb { width: 50px; height: 50px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; border: 1px solid var(--border); }
.driver-info { flex: 1; min-width: 0; }
.driver-name { font-size: 0.95rem; font-weight: 800; color: var(--text); }
.driver-car { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.driver-meta { text-align: right; flex-shrink: 0; }
.driver-seats { font-size: 0.85rem; font-weight: 800; color: var(--blue); }
.driver-seats.full { color: var(--red); }
.queue-pos { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 0.7rem; font-weight: 800; position: absolute; top: -8px; left: -8px; box-shadow: var(--shadow-sm); }

/* Stars */
.stars { display: flex; gap: 2px; margin-top: 4px; }
.star { font-size: 0.9rem; color: #E5E7EB; cursor: pointer; transition: color 0.15s; }
.star.filled { color: var(--amber); }
.star.half { color: var(--amber); opacity: 0.6; }
.rating-display { font-size: 0.75rem; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; font-weight: 500; }
.rating-val { color: var(--blue); font-weight: 800; }

/* Booking Summary */
.booking-summary { background: var(--card); border-radius: 20px; padding: 20px; margin-bottom: 16px; border: 1.5px solid var(--blue-mid); }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 0.9rem; border-bottom: 1px solid rgba(26, 86, 219, 0.08); }
.summary-row:last-child { border-bottom: none; padding-bottom: 0; }
.summary-row:first-child { padding-top: 0; }
.summary-row .key { color: var(--text-secondary); font-weight: 600; font-size: 0.85rem; }
.summary-row .val { color: var(--text); font-weight: 800; font-size: 0.95rem; text-align: right; }
.summary-row .val.amber { color: var(--blue); font-size: 1.1rem; }

.contact-block { background: var(--input-bg); border-radius: 20px; padding: 16px; margin-top: 16px; border: 1px solid var(--border); }
.contact-block-title { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; }
.contact-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 0.9rem; color: var(--text); border-bottom: 1px solid var(--border); }
.contact-row:last-child { border-bottom: none; padding-bottom: 0; }
.contact-row:first-child { padding-top: 0; }
.contact-icon { font-size: 1.1rem; flex-shrink: 0; width: 24px; text-align: center; }
.contact-link { color: var(--blue); text-decoration: none; font-weight: 700; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.02em; }
.badge-waiting { background: var(--blue-light); color: var(--blue); }
.badge-confirmed { background: var(--green-light); color: var(--green); }
.badge-full { background: var(--red-light); color: var(--red); }
.pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ================= PROFILE PANEL ================= */
.profile-overlay { display: none; position: fixed; inset: 0; padding-top: env(safe-area-inset-top); background: rgba(17, 24, 39, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 199; transition: opacity 0.3s ease; }
.profile-overlay.show { display: block; }
.profile-panel { position: fixed; top: 0; right: -100%; width: 100%; max-width: 420px; height: 100dvh; background: var(--card); z-index: 200; transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1); overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,0.1); }
@media (max-width: 440px) { .profile-panel { max-width: 100%; } }
.profile-panel.open { right: 0; }
.profile-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 10; }
.profile-title { font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--text); }
.close-btn { background: var(--input-bg); border: none; color: var(--text-secondary); font-size: 1.2rem; cursor: pointer; width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.close-btn:hover { color: var(--text); background: var(--border); }

.profile-avatar-big { width: 80px; height: 80px; border-radius: 50%; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 24px auto 16px; overflow: hidden; border: 3px solid var(--card); box-shadow: var(--shadow-sm); }
.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { text-align: center; font-size: 1.25rem; font-weight: 900; color: var(--text); margin-bottom: 4px; }
.profile-role-tag { text-align: center; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); margin-bottom: 24px; display: block; }

.profile-info-block { background: var(--input-bg); border-radius: 20px; padding: 8px 16px; margin: 0 20px 16px; border: 1px solid var(--border); }
.profile-info-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; font-size: 0.95rem; color: var(--text); border-bottom: 1px solid var(--border); font-weight: 500; }
.profile-info-row:last-child { border-bottom: none; }
.profile-info-icon { font-size: 1rem; color: var(--text-secondary); flex-shrink: 0; width: 20px; }

.car-photo-block { border-radius: 20px; overflow: hidden; margin: 0 20px 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.car-photo-block img { width: 100%; height: 150px; object-fit: cover; }
.car-photo-placeholder { margin: 0 20px 16px; height: 120px; background: var(--input-bg); border-radius: 20px; border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--muted); font-size: 0.85rem; font-weight: 500; }

.reviews-section { margin: 0 20px 20px; }
.review-item { background: var(--input-bg); border-radius: 16px; padding: 16px; margin-bottom: 10px; border: 1px solid var(--border); }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-author { font-size: 0.85rem; font-weight: 800; color: var(--text); }
.review-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

/* ================= MODALS ================= */
.modal-overlay { display: none; position: fixed; inset: 0; padding-top: env(safe-area-inset-top); background: rgba(17, 24, 39, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 300; align-items: flex-end; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-overlay.closing { display: flex; animation: overlayFadeOut 0.25s ease forwards; }
.modal-overlay.closing .modal { animation: modalSlideDown 0.25s cubic-bezier(0.4, 0, 1, 1) forwards; }
.modal { background: var(--card); border: none; border-radius: 32px 32px 0 0; padding: 32px 24px 40px; width: 100%; max-width: 500px; animation: modalSlideUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1); max-height: 90dvh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(0,0,0,0.1); position: relative; }
.modal::before { content: ''; width: 40px; height: 5px; background: var(--border); border-radius: 3px; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); }

@keyframes modalSlideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes modalSlideDown { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100%); opacity: 0; } }
@keyframes overlayFadeOut { from { opacity: 1; } to { opacity: 0; } }
.modal-title { font-family: 'Inter', sans-serif; font-size: 1.2rem; font-weight: 900; letter-spacing: -0.01em; color: var(--text); margin-bottom: 20px; text-align: center; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.modal-actions .btn { flex: 1; }

/* ================= NOTIFICATIONS ================= */
.notif { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #1F2937; border: none; border-radius: 20px; padding: 14px 24px; font-size: 0.9rem; font-weight: 700; color: #fff; z-index: 9999; animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1), fadeOutUp 0.4s 3s forwards; max-width: 90%; box-shadow: var(--shadow-lg); text-align: center; font-family: 'Inter', sans-serif; display: flex; align-items: center; gap: 8px; }@keyframes slideDown { from { transform: translateX(-50%) translateY(-30px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
@keyframes fadeOutUp { to { opacity: 0; transform: translateX(-50%) translateY(-20px); } }

/* Driver in Queue Expansion */
.driver-expanded { display: none; padding: 16px 0 0; border-top: 1px solid var(--border); margin-top: 16px; }
.driver-expanded.open { display: block; animation: stepIn 0.2s ease; }
.car-photo-queue { width: 100%; height: 120px; object-fit: cover; border-radius: 16px; margin-bottom: 12px; border: 1px solid var(--border); }
.reviews-mini .review-item { padding: 12px; margin-bottom: 8px; border-radius: 12px; }

/* Review Picker */
.review-stars-pick { display: flex; gap: 8px; margin: 10px 0 20px; justify-content: center; }
.review-star-pick { font-size: 2.2rem; cursor: pointer; color: #E5E7EB; transition: all 0.2s; }
.review-star-pick:hover { transform: scale(1.1); }
.review-star-pick.lit { color: var(--amber); }

/* ================= DARK MODE ================= */
/* Нативная поддержка и ручное переключение используют одни переменные */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827; 
    --card: #1F2937; 
    --input-bg: #374151;
    --text: #F9FAFB; 
    --text-secondary: #9CA3AF;
    --muted: #6B7280;
    --border: #374151; 
    --border-light: #4B5563;
    
    --blue: #3B82F6; 
    --blue-hover: #60A5FA;
    --blue-light: rgba(59, 130, 246, 0.15); 
    --blue-mid: rgba(59, 130, 246, 0.3);
    --blue-dark: #2563EB;
    
    --green: #10B981; 
    --green-light: rgba(16, 185, 129, 0.15); 
    --green-mid: rgba(16, 185, 129, 0.3);
    
    --red: #EF4444; 
    --red-light: rgba(239, 68, 68, 0.15);
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-blue: 0 4px 15px -3px rgba(59, 130, 246, 0.4);
    
    --road: #111827; 
    --road2: #1F2937; 
    --card-bg: #1F2937;
  }
}

body.dark-mode {
  --bg: #111827; 
  --card: #1F2937; 
  --input-bg: #374151;
  --text: #F9FAFB; 
  --text-secondary: #9CA3AF;
  --muted: #6B7280;
  --border: #374151; 
  --border-light: #4B5563;
  
  --blue: #3B82F6; 
  --blue-hover: #60A5FA;
  --blue-light: rgba(59, 130, 246, 0.15); 
  --blue-mid: rgba(59, 130, 246, 0.3);
  --blue-dark: #2563EB;
  
  --green: #10B981; 
  --green-light: rgba(16, 185, 129, 0.15); 
  --green-mid: rgba(16, 185, 129, 0.3);
  
  --red: #EF4444; 
  --red-light: rgba(239, 68, 68, 0.15);
  
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-blue: 0 4px 15px -3px rgba(59, 130, 246, 0.4);
  
  --road: #111827; 
  --road2: #1F2937; 
  --card-bg: #1F2937;
  
  background: var(--bg);
}

/* Стили элементов в темной теме */
@media (prefers-color-scheme: dark) {
  .card, .car-stage, .driver-card, .modal { border: 1px solid rgba(255,255,255,0.05); }
  .auth-wrap, .dreg-wrap { background: var(--bg); }
  input, select, textarea { box-shadow: none; }
  .btn-outline { background: transparent; }
  .btn-outline:hover { background: var(--input-bg); }
  .profile-panel { box-shadow: -10px 0 40px rgba(0,0,0,0.5); }
}

body.dark-mode .card, 
body.dark-mode .car-stage, 
body.dark-mode .driver-card, 
body.dark-mode .modal { border: 1px solid rgba(255,255,255,0.05); background: var(--card); }
body.dark-mode .auth-wrap, 
body.dark-mode .dreg-wrap { background: var(--bg); }
body.dark-mode input, 
body.dark-mode select, 
body.dark-mode textarea { box-shadow: none; background: var(--input-bg); color: var(--text); }
body.dark-mode input:focus, 
body.dark-mode select:focus, 
body.dark-mode textarea:focus { background: var(--card); border-color: var(--blue); }
body.dark-mode .btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
body.dark-mode .btn-outline:hover { background: var(--input-bg); }
body.dark-mode .profile-panel { background: var(--card); box-shadow: -10px 0 40px rgba(0,0,0,0.5); }
body.dark-mode .notif { color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
body.dark-mode header { background: var(--card); }
/* Fix address text on green passenger cards in dark mode */
@media (prefers-color-scheme: dark) {
  .driver-card span, .card span { color: var(--text); }
}
body.dark-mode .driver-card span,
body.dark-mode .card span { color: var(--text); }

/* Passenger card backgrounds for dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --card-pending: #2a2510;
    --card-pending-border: #5a4a00;
    --card-enroute: #0d1a2a;
    --card-enroute-border: #1e3a5f;
    --card-arrived: #0d2318;
    --card-arrived-border: #1a5c35;
  }
}
body.dark-mode {
  --card-pending: #2a2510;
  --card-pending-border: #5a4a00;
  --card-enroute: #0d1a2a;
  --card-enroute-border: #1e3a5f;
  --card-arrived: #0d2318;
  --card-arrived-border: #1a5c35;
}





/* Road illustration theme switching */
.road-dark { display: none !important; }
.road-light { display: block !important; }
@media (prefers-color-scheme: dark) {
  .road-dark { display: block !important; }
  .road-light { display: none !important; }
}
body.dark-mode .road-dark { display: block !important; }
body.dark-mode .road-light { display: none !important; }




/* Date input fix */
input[type=date] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  min-height: 48px;
}
input[type=date]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}

/* ================= COLOR SWATCHES ================= */
.color-swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; flex-shrink: 0; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
#regColorPicker { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= EMPTY STATE ================= */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.empty-state-sub { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* ================= DRIVER CARD HIERARCHY ================= */
.driver-card-route { font-size: 1rem; font-weight: 900; color: var(--text); margin-bottom: 2px; letter-spacing: -0.01em; }
.driver-card-meta { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

/* ================= NOTIF BADGE ================= */
#passengerNotifBadge, #driverNotifBadge { border-radius: 20px; padding: 5px 10px; font-size: 0.72rem; font-weight: 800; animation: pulse 2s infinite; }

/* ================= DARK MODE BOOKING SUMMARY ================= */
body.dark-mode .booking-summary { background: var(--card); border-color: var(--blue-mid); }
@media (prefers-color-scheme: dark) { .booking-summary { background: var(--card); border-color: var(--blue-mid); } }

/* ================= DARK MODE BTN-DANGER ================= */
body.dark-mode .btn-danger { background: #DC2626; color: #fff; }
@media (prefers-color-scheme: dark) { .btn-danger { background: #DC2626; color: #fff; } }

/* ================= iOS SAFE AREA ================= */
/* Фон под монобровью совпадает с хедером */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    background-color: var(--card);
  }
  .app {
    background-color: var(--bg);
  }
}

/* ==================== TRIP TABS ==================== */
.trip-tab-btn { flex:1; padding:10px 8px; border-radius:12px 12px 0 0; border:none; background:transparent; font-family:'Inter',sans-serif; font-size:0.78rem; font-weight:700; color:var(--muted); cursor:pointer; transition:all 0.2s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.trip-tab-btn.active { background:var(--card); color:var(--blue); box-shadow:var(--shadow-sm); }
.trip-tab-btn:disabled { opacity:.4; cursor:not-allowed; }
.pick-wrap > div:first-child { flex:0 0 60px; }


.contact-block-body { display: none; margin-top: 12px; }
.contact-block.open .contact-block-body { display: block; }
.contact-block.open .contact-block-title svg { transform: rotate(180deg); }