:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #111827;
  --text-2: #6b7280;
  --primary: #1b5e3f;
  --primary-2: #2d8a5e;
  --primary-light: #ecfdf5;
  --accent: #10b981;
  --danger: #d94a3a;
  --warning: #f0b429;
  --border: #e5e7eb;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.10);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.screens {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 90px);
  -webkit-overflow-scrolling: touch;
}

.screen {
  display: none;
  animation: fadeIn 0.25s ease;
  padding-top: 8px;
}

.screen.active {
  display: block;
}

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

[hidden] {
  display: none !important;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  padding: 28px 20px 22px;
  margin: 0 -16px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-radius: 0 0 24px 24px;
}

.header h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.header p {
  font-size: 14px;
  opacity: 0.9;
  margin: 8px 0 0;
}

/* ---------- Typography ---------- */
.h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 18px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 20px 0 10px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: -8px 0 12px;
}

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s, opacity 0.15s;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent), #059669);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1.5px solid #fecaca;
}

.btn-ghost {
  background: transparent;
  color: var(--primary-2);
  border: 1.5px solid var(--border);
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
}

/* ---------- Role selection ---------- */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.role-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 28px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.role-card:hover,
.role-card:active {
  border-color: var(--primary-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.role-card .icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.role-card h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.role-card p {
  font-size: 12px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.4;
}

/* ---------- Action cards ---------- */
.action-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s, transform 0.08s;
}

.action-card:hover,
.action-card:active {
  border-color: var(--primary-2);
  transform: translateY(-1px);
}

.action-icon {
  font-size: 26px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 14px;
  flex-shrink: 0;
}

.action-text {
  flex: 1;
}

.action-text h4 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
}

.action-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.35;
}

.action-arrow {
  font-size: 18px;
  color: var(--text-2);
}

/* ---------- Forms ---------- */
.input-group {
  margin-bottom: 14px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.input-field,
select.input-field,
textarea.input-field {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
}

.input-field:focus,
select.input-field:focus {
  outline: none;
  border-color: var(--primary-2);
}

.input-field:disabled {
  background: #e5e7eb;
  color: var(--text-2);
}

textarea.input-field {
  min-height: 80px;
  resize: vertical;
}

.hint {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.4;
}

/* ---------- Route visual ---------- */
.route-visual {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 12px;
}

.route-point {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.route-point.start { background: var(--primary); }
.route-point.end { background: #e76f51; }

.route-line {
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, #cbd5e1 0, #cbd5e1 4px, transparent 4px, transparent 8px);
}

.route-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

/* ---------- Lists ---------- */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-2);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text);
  margin: 0 0 6px;
}

.empty-state p {
  font-size: 14px;
  margin: 0;
}

/* ---------- Trip / request cards ---------- */
.item-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.item-card:hover,
.item-card:active {
  border-color: var(--primary-2);
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.item-card-route {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.item-card-meta {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.item-card-price {
  font-weight: 800;
  color: var(--accent);
  font-size: 16px;
  white-space: nowrap;
}

.item-card-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
}

.status-active { background: var(--primary-light); color: var(--primary); }
.status-pending { background: #fff7ed; color: #9a3412; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-filled { background: #e0e7ff; color: #3730a3; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin: 0 4px 4px 0;
}

.badge-green { background: var(--primary-light); color: var(--primary); }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-gray { background: #f3f4f6; color: var(--text-2); }

.now-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffedd5, #fed7aa);
  color: #9a3412;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Profile ---------- */
.profile-card {
  text-align: center;
  padding: 24px 16px;
}

.profile-setup .card {
  margin-top: 16px;
}

.profile-setup .gender-chip {
  min-height: 44px;
  padding: 8px 18px;
}

.gender-chip.active {
  border-color: var(--primary-2);
  background: var(--primary-light);
  color: var(--primary);
}

.user-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-info-name {
  font-size: 18px;
  font-weight: 700;
}

.user-info-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c084fc, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 12px;
}

/* ---------- Info rows ---------- */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

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

.info-label {
  color: var(--text-2);
}

.info-value {
  font-weight: 700;
}

/* ---------- Back button ---------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  margin: 12px 0 14px;
  background: none;
  border: none;
  padding: 6px 0;
}

/* ---------- Chips ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
}

.chip.active {
  border-color: var(--primary-2);
  background: var(--primary-light);
  color: var(--primary);
}

/* ---------- Toggle ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.toggle-label {
  font-size: 14px;
}

.toggle-switch {
  width: 46px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch.on {
  background: var(--accent);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.on::after {
  transform: translateX(20px);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%);
  z-index: 2000;
  max-width: 86vw;
  padding: 12px 18px;
  border-radius: 12px;
  background: #1c1f24;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.toast.is-error {
  background: var(--danger);
}

/* ---------- Loading overlay ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(243, 244, 246, 0.92);
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- Dev badge ---------- */
.dev-badge {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: 8px;
  z-index: 2001;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--warning);
  color: #1c1f24;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Deal actions ---------- */
.deal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.deal-actions .btn {
  min-height: 40px;
  font-size: 14px;
}

/* ---------- Contact reveal ---------- */
.contact-card {
  background: linear-gradient(135deg, var(--primary-light), #d1fae5);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}

.contact-card h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 15px;
}

.contact-card p {
  margin: 0;
  color: var(--primary-2);
  font-size: 14px;
}

.contact-phone {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

/* ---------- Driver preview ---------- */
.driver-preview {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
}

.driver-preview .card-title {
  color: var(--primary);
}

.driver-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 14px;
}

.rating-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.rating-stars {
  letter-spacing: -1px;
}

.rating-count {
  color: var(--text-2);
  font-size: 12px;
}

.rating-new {
  color: var(--text-2);
  font-weight: 600;
}

.driver-vehicle {
  font-size: 14px;
  color: var(--text);
}

.vehicle-plate {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ---------- Reviews ---------- */
.review-form-card {
  margin-top: 12px;
}

.review-value-chips {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.review-value-chips .chip {
  flex: 1;
  justify-content: center;
  min-height: 44px;
  font-size: 15px;
}

.review-value-chips .chip.active[data-value="up"] {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-2);
}

.review-value-chips .chip.active[data-value="down"] {
  background: #fee2e2;
  color: var(--danger);
  border-color: var(--danger);
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.review-tags .chip {
  font-size: 13px;
  min-height: 34px;
}

.review-tags .chip.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-2);
}

.reviews-list {
  margin-top: 12px;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.review-item.review-up {
  border-left: 4px solid var(--accent);
}

.review-item.review-down {
  border-left: 4px solid var(--danger);
}

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

.review-value {
  font-size: 18px;
}

.review-author {
  font-size: 12px;
  color: var(--text-2);
}

.review-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.review-comment {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}

.empty-hint {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  margin: 12px 0;
}

/* ---------- Route picker ---------- */
.route-picker {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.route-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.route-side {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.route-side-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}

.city-chips .chip,
.point-chips .chip,
.child-chips .chip {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
}

.city-chips .chip {
  font-weight: 700;
  background: var(--surface);
}

.point-chips .chip {
  font-weight: 600;
}

.point-parent {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.child-chips {
  margin-top: 10px;
}

.child-chips .chip {
  background: #f8fafc;
  font-weight: 500;
}

.chip-back {
  background: var(--surface);
  color: var(--text-2);
  border-style: dashed;
}

.chip-geo {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
  font-weight: 600;
  margin-bottom: 8px;
}

.route-chip {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
  font-weight: 600;
}

.selected-point {
  background: var(--surface);
  border: 1.5px solid var(--primary-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-point-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.selected-point-hint {
  font-size: 13px;
  color: var(--text-2);
}

.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  align-self: flex-start;
}

/* ---------- Time / day / seat / price chips ---------- */
.time-chip,
.window-chip,
.day-chip,
.seat-chip,
.price-chip,
.mode-chip {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}

.time-chip.active,
.window-chip.active {
  border-color: var(--primary-2);
  background: var(--primary-light);
  color: var(--primary);
}

.day-chip {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
}

.seat-chip {
  min-width: 48px;
}

.chip.price-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Progress bar ---------- */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ---------- Input row ---------- */
.input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Notification card from prototype ---------- */
.notification-card {
  background: linear-gradient(135deg, var(--primary-light), #d1fae5);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}

.notification-card h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 15px;
}

.notification-card p {
  margin: 0;
  color: var(--primary-2);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Onboarding / Home ---------- */
.onboarding {
  text-align: center;
  padding: 40px 16px;
}
.onboarding-logo {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 16px;
}
.onb-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.onb-row:last-child {
  border-bottom: none;
}
.onb-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary-2);
}
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.home-logo {
  font-weight: 800;
  font-size: 16px;
  color: var(--primary);
}
.btn-icon {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}
.home-greeting {
  font-size: 20px;
  font-weight: 700;
  padding: 20px 16px 8px;
}
.home-vehicle {
  font-size: 13px;
  color: var(--text-2);
  padding: 0 16px 8px;
}
.home-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}
.home-action-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
}
.home-action-card:active {
  transform: scale(0.98);
}
.home-action-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.home-action-title {
  font-weight: 700;
  font-size: 15px;
}
.home-action-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}
.template-mini {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.template-mini:last-child {
  border-bottom: none;
}
.template-time {
  color: var(--text-2);
  font-size: 13px;
}
.home-menu {
  padding: 0 16px 24px;
  display: grid;
  gap: 8px;
}
.home-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
}
.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.settings-chevron {
  color: var(--text-2);
  font-size: 18px;
}

/* ---------- Chat ---------- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 60vh;
}
.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.chat-message.chat-mine {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-message.chat-theirs {
  align-self: flex-start;
  align-items: flex-start;
}
.chat-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
}
.chat-mine .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.chat-time {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px 24px;
}
.chat-input-row .input-field {
  flex: 1;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}
.tab {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Ride mode switch (role both) ---------- */
.ride-mode-switch {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
}
.ride-mode-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}
.ride-mode-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Home secondary action ---------- */
.home-action-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.home-action-secondary::after {
  content: "›";
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
}
.home-action-secondary:active {
  transform: scale(0.99);
  background: var(--surface-2);
}

/* ---------- Templates ---------- */
.template-card {
  margin-bottom: 12px;
}
.template-route {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.template-meta {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.template-actions {
  display: flex;
  gap: 8px;
}
.template-actions .btn {
  flex: 1;
}
#tmf-days .chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Bottom navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 58px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: 6px 2px 5px;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, transform 0.08s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
  color: var(--primary-2);
  transform: scale(0.94);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.bottom-nav-item .nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-item .nav-icon svg {
  width: 100%;
  height: 100%;
}

.bottom-nav-item .nav-label {
  font-size: 10px;
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.1;
  letter-spacing: 0.2px;
}

.bottom-nav-plus .nav-icon {
  width: 28px;
  height: 28px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  padding: 5px;
  margin-bottom: 1px;
  transition: background 0.15s, border-color 0.15s;
}

.bottom-nav-plus.active .nav-icon {
  background: var(--primary-light);
  border-color: var(--primary-2);
}

/* ---------- Route picker v2: city/point search & geo ---------- */
.rp-city-wrap {
  position: relative;
  margin-bottom: 8px;
}
.rp-city-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 20;
  box-shadow: var(--shadow);
}
.rp-suggested-label {
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.rp-suggested-cities {
  margin-bottom: 8px;
}
.rp-city-dropdown-label {
  padding: 8px 12px 4px;
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.rp-city-dropdown-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}
.rp-city-dropdown-item:hover,
.rp-city-dropdown-item:focus {
  background: var(--surface-2);
}
.rp-point-search {
  margin-top: 14px;
}
.rp-point-search .input-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-2);
}



/* ---------- Address picker (свободный ввод адреса) ---------- */
.ap-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ap-row .ap-input {
  flex: 1;
}
.ap-geo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.ap-geo:disabled {
  opacity: 0.5;
}
.ap-dropdown {
  margin-top: 6px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.ap-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}
.ap-item:hover,
.ap-item:focus {
  background: var(--surface-2);
}
.ap-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  background: #ecfdf5;
  font-size: 13px;
  font-weight: 600;
}
.ap-chip-far {
  border-color: var(--warning);
  background: #fffbeb;
}
.ap-clear {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  padding: 2px 6px;
}
.ap-recent {
  margin-top: 4px;
}
.ap-recent-title {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ap-manual {
  display: block;
  margin: 12px auto 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.ap-stops {
  margin-top: 10px;
}
.ap-stops-title {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ap-stops-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.ap-stops-list .chip {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
.ap-stops-list .chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
