/* M2c Drive UI styles */

#ag-nav-shell[data-mounted="true"] {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

#ag-nav-shell[data-mounted="true"] .ag-nav-sidebar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 320px;
  background: white;
  border-right: 1px solid #e5e7eb;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.08);
}

#ag-nav-shell[data-mounted="true"] .ag-nav-map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Hide discovery UI when nav is mounted */
body:has(#ag-nav-shell[data-mounted="true"]) #ag-dir,
body:has(#ag-nav-shell[data-mounted="true"]) #ag-service-filters,
body:has(#ag-nav-shell[data-mounted="true"]) #ag-results-popup {
  display: none !important;
}

/* Maneuver banner */
.ag-nav-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: white;
  border-bottom: 1px solid #e8eaed;
}
.ag-nav-banner-arrow { font-size: 30px; color: #1a73e8; font-weight: 900; line-height: 1; }
.ag-nav-banner-text { flex: 1; min-width: 0; }
.ag-nav-banner-distance { font-size: 22px; font-weight: 500; color: #202124; letter-spacing: -0.5px; }
.ag-nav-banner-instruction { font-size: 13px; color: #202124; margin-top: 2px; }

/* Then pill */
.ag-nav-then-pill { background: #f1f3f4; padding: 8px 14px; font-size: 11px; color: #5f6368; border-bottom: 1px solid #e8eaed; }

/* Lane strip */
.ag-nav-lane-strip { background: #f8fafc; padding: 8px 12px; display: flex; gap: 8px; justify-content: center; border-bottom: 1px solid #e8eaed; }
.ag-nav-lane { font-size: 18px; font-weight: 700; color: #cbd5e1; }
.ag-nav-lane-active { color: #1a73e8; }

/* Step list */
.ag-nav-step-list { padding: 12px 14px; flex: 1; overflow-y: auto; }
.ag-nav-step-list-title { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; margin-bottom: 8px; }
.ag-nav-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.ag-nav-step-arrow { width: 22px; height: 22px; background: #f3f4f6; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #4b5563; font-size: 13px; }
.ag-nav-step-active .ag-nav-step-arrow { background: #dbeafe; color: #1e40af; }
.ag-nav-step-info { flex: 1; }
.ag-nav-step-name { font-size: 12px; color: #202124; font-weight: 500; }
.ag-nav-step-dist { font-size: 10px; color: #6b7280; margin-top: 1px; }

/* ETA card */
.ag-nav-eta-card { padding: 14px; background: white; border-top: 1px solid #e5e7eb; }
.ag-nav-eta-stats { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ag-nav-eta-stat { text-align: center; }
.ag-nav-eta-stat-value { font-size: 18px; font-weight: 700; color: #202124; letter-spacing: -0.3px; line-height: 1; }
.ag-nav-eta-time-val { color: #137333; }
.ag-nav-eta-stat-label { font-size: 9px; color: #6b7280; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.ag-nav-end-route-btn { width: 100%; background: #ea4335; color: white; padding: 9px; border-radius: 8px; text-align: center; font-size: 12px; font-weight: 700; border: none; cursor: pointer; }

/* Speed shield */
.ag-nav-speed-shield {
  position: absolute;
  top: 12px; left: 12px;
  width: 44px; height: 44px;
  background: white;
  border: 3px solid #94a3b8;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}
.ag-nav-speed-shield.ag-nav-speed-over { border-color: #dc2626; }
.ag-nav-speed-num { font-size: 16px; font-weight: 800; color: #0a0f1c; line-height: 1; }
.ag-nav-speed-unit { font-size: 7px; color: #64748b; font-weight: 600; }

/* ===== M2d additions ===== */

/* PrivacyPicker */
.ag-priv-row { display: flex; gap: 6px; }
.ag-priv-tile {
  flex: 1; padding: 10px 4px; border-radius: 10px;
  background: #f9fafb; border: 1px solid #e5e7eb;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; font-family: inherit;
}
.ag-priv-tile-selected { background: #dcfce7; border-color: #86efac; }
.ag-priv-icon { font-size: 18px; }
.ag-priv-label { font-size: 9px; font-weight: 700; color: #6b7280; }
.ag-priv-tile-selected .ag-priv-label { color: #14532d; }

/* AddPanel */
.ag-add-panel {
  position: absolute; bottom: 70px; right: 14px;
  width: 320px; max-height: calc(100vh - 100px);
  background: white; border: 1px solid #e5e7eb;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  pointer-events: auto;
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 60;
}
.ag-add-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid #f3f4f6;
}
.ag-add-title { font-size: 14px; font-weight: 700; color: #111827; }
.ag-add-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 20px; font-weight: 700; color: #6b7280;
  padding: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.ag-add-close:hover { background: #f3f4f6; }
.ag-add-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid #f3f4f6;
  background: white; border-left: none; border-right: none; border-top: none;
  cursor: pointer; text-align: left; font-family: inherit; width: 100%;
}
.ag-add-row:hover { background: #f9fafb; }
.ag-add-row:last-child { border-bottom: none; }
.ag-add-icon { font-size: 20px; width: 36px; text-align: center; flex-shrink: 0; }
.ag-add-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-add-row-title { font-size: 13px; font-weight: 600; color: #111827; }
.ag-add-row-sub { font-size: 11px; color: #6b7280; }
.ag-add-chev { font-size: 14px; color: #9ca3af; flex-shrink: 0; }

/* HazardReportForm */
.ag-hazard-form {
  padding: 14px; background: white;
  display: flex; flex-direction: column; gap: 8px;
}
.ag-hazard-title { font-size: 14px; font-weight: 700; color: #111827; margin: 0 0 6px 0; }
.ag-hazard-label {
  font-size: 10px; color: #6b7280; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 700; margin-top: 8px;
}
.ag-hazard-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-hazard-chip {
  padding: 7px 10px; border-radius: 8px;
  background: #f9fafb; border: 1px solid #e5e7eb;
  font-size: 12px; color: #1f2937; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.ag-hazard-chip-selected { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.ag-hazard-sevrow { display: flex; gap: 6px; }
.ag-hazard-sev {
  flex: 1; padding: 7px 0; border-radius: 8px;
  background: #f9fafb; border: 1px solid #e5e7eb;
  font-size: 11px; color: #6b7280; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.ag-hazard-sev[data-sev="low"].ag-hazard-sev-selected { background: #dcfce7; border-color: #86efac; color: #0f172a; }
.ag-hazard-sev[data-sev="medium"].ag-hazard-sev-selected { background: #fef3c7; border-color: #fcd34d; color: #0f172a; }
.ag-hazard-sev[data-sev="high"].ag-hazard-sev-selected { background: #fee2e2; border-color: #fca5a5; color: #0f172a; }
.ag-hazard-hint { font-size: 11px; color: #4b5563; font-style: italic; margin-top: 2px; }
.ag-hazard-error { font-size: 12px; color: #b91c1c; margin-top: 8px; }
.ag-hazard-actions { display: flex; gap: 8px; margin-top: 12px; }
.ag-hazard-cancel {
  flex: 1; padding: 11px; border-radius: 10px;
  background: #f3f4f6; color: #4b5563;
  font-size: 13px; font-weight: 600; border: none; cursor: pointer; font-family: inherit;
}
.ag-hazard-submit {
  flex: 2; padding: 11px; border-radius: 10px;
  background: #b91c1c; color: white;
  font-size: 13px; font-weight: 700; border: none; cursor: pointer; font-family: inherit;
}
.ag-hazard-submit:disabled { opacity: 0.6; cursor: default; }

/* MuteToggle */
.ag-mute-btn {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px; border-radius: 20px;
  background: white; border: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
  z-index: 55;
}
.ag-mute-btn-muted { background: #fee2e2; border-color: #fca5a5; }

/* OffRouteChip */
.ag-offroute-chip {
  position: absolute; top: 60px; right: 12px;
  display: flex; align-items: center; gap: 6px;
  background: white; padding: 6px 10px; border-radius: 999px;
  border: 1px solid; pointer-events: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
  z-index: 55;
  font-size: 12px; font-weight: 700;
}
.ag-offroute-amber { border-color: #fcd34d; color: #92400e; }
.ag-offroute-red { border-color: #dc2626; color: #7f1d1d; }
.ag-offroute-icon { font-size: 14px; }

/* Plus button (drive template) */
.ag-nav-plus-btn {
  width: 100%; margin-top: 8px;
  padding: 9px; border-radius: 8px;
  background: #f3f4f6; color: #374151;
  font-size: 12px; font-weight: 700; border: none; cursor: pointer; font-family: inherit;
}
.ag-nav-plus-btn:hover { background: #e5e7eb; }

/* Hazard form floating overlay (drive template) */
.ag-hazard-form-floating {
  position: absolute; right: 14px; bottom: 70px;
  width: 380px; max-height: calc(100vh - 100px);
  background: white; border: 1px solid #e5e7eb;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  z-index: 60; pointer-events: auto;
  overflow-y: auto;
}
