/* =========================================================
   drive-tracker.css v7 — GPS Tracker Overlay
   ========================================================= */

.dt-fullscreen-body { overflow: hidden !important; position: fixed; width: 100%; height: 100%; }
.dt-fullscreen-card {
  position: fixed !important; top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important; width: 100% !important;
  height: 100% !important; margin: 0 !important; padding: 0 !important;
  border-radius: 0 !important; border: none !important; z-index: 4999;
  background: #000 !important;
}
.dt-fullscreen-card .card-head { display: none !important; }
.dt-fullscreen-card .map-legend { display: none !important; }
.dt-fullscreen-map { width: 100% !important; height: 100% !important; border-radius: 0 !important; }

#dt-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 5000; }
#dt-overlay * { pointer-events: auto; }

.dt-pill {
  position: fixed; background: rgba(0, 0, 0, 0.78); color: #fff;
  border: none; border-radius: 16px; padding: 8px 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); white-space: nowrap; z-index: 5001;
}

.dt-top-left { top: 16px; left: 12px; text-align: center; min-width: 64px; padding: 6px 12px; cursor: pointer; }
.dt-speed-num { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.dt-speed-unit { font-size: 10px; font-weight: 400; opacity: 0.6; }
.dt-speed-dir { font-size: 12px; font-weight: 700; color: #60a5fa; margin-top: 1px; }

.dt-top-center { top: 16px; left: 50%; transform: translateX(-50%); font-size: 15px; font-weight: 700; padding: 8px 16px; }
.dt-top-right {
  top: 16px; right: 12px; cursor: pointer; font-size: 14px;
  padding: 8px 14px; font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dt-top-right:active { background: rgba(255, 255, 255, 0.3); color: #fff; }
.dt-top-right:focus { outline: none; background: rgba(0, 0, 0, 0.78); color: #fff; }

.dt-recenter-btn {
  position: fixed; top: 68px; right: 12px;
  background: rgba(66, 133, 244, 0.9); color: #fff;
  border: none; border-radius: 20px; padding: 8px 18px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  z-index: 5003; pointer-events: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 2px 10px rgba(66, 133, 244, 0.4);
}
.dt-recenter-btn:active { background: rgba(66, 133, 244, 1); }

.dt-gps-status {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
  background: rgba(200, 60, 40, 0.85); color: #fff; border-radius: 20px;
  padding: 6px 16px; font-size: 13px; font-weight: 500;
  z-index: 5002; pointer-events: auto;
}

.dt-off-route {
  position: fixed; top: 68px; left: 12px; right: 12px;
  background: rgba(220, 38, 38, 0.9); color: #fff; border-radius: 14px;
  padding: 12px 16px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  z-index: 5003; pointer-events: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dt-recalc-btn {
  background: #fff; color: #dc2626; border: none; border-radius: 20px;
  padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}

.dt-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 5001; pointer-events: auto;
}
.dt-next-turn {
  color: #fff; font-size: 14px; font-weight: 500; line-height: 1.4;
  margin-bottom: 12px; min-height: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dt-turn-dist { font-weight: 700; color: #60a5fa; margin-right: 4px; }
.dt-turn-chain { font-size: 12px; color: #f59e0b; margin-top: 4px; font-weight: 600; }
.dt-bottom-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }
.dt-action-btn {
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.dt-action-btn:active { background: rgba(255, 255, 255, 0.25); }
.dt-end-btn {
  background: rgba(220, 50, 40, 0.85); color: #fff; border: none;
  border-radius: 28px; padding: 12px 28px; font-size: 15px; font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer; box-shadow: 0 4px 20px rgba(220, 50, 40, 0.4);
}
.dt-end-btn:active { background: rgba(200, 30, 20, 0.95); transform: scale(0.96); }

/* ── mic active ── */
.dt-mic-active { background: rgba(220, 38, 38, 0.7) !important; animation: dt-mic-pulse 1s ease infinite; }
@keyframes dt-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

/* ── search panel ── */
.dt-search-panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1a1d2e; border-top-left-radius: 20px; border-top-right-radius: 20px;
  padding: 20px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 5010; pointer-events: auto; max-height: 70vh; overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dt-search-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 14px; text-align: center; }
.dt-search-cats { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.dt-search-cat {
  padding: 12px 16px; border: 1px solid #2a2d3e; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); color: #e0e0e0; font-size: 15px;
  font-weight: 600; text-align: left; cursor: pointer;
}
.dt-search-cat:active { background: rgba(96, 165, 250, 0.15); border-color: #60a5fa; }
.dt-search-results { display: flex; flex-direction: column; gap: 8px; }
.dt-search-loading { text-align: center; padding: 20px; color: #888; font-size: 14px; }
.dt-search-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05);
  border: 1px solid #2a2d3e;
}
.dt-search-info { flex: 1; min-width: 0; }
.dt-search-name { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-search-meta { font-size: 12px; color: #888; margin-top: 2px; }
.dt-search-go {
  background: #2563eb; color: #fff; border: none; border-radius: 20px;
  padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.dt-search-go:active { background: #1d4ed8; }
.dt-search-close {
  display: block; width: 100%; padding: 12px; border: 1px solid #333;
  border-radius: 12px; background: transparent; color: #888; font-size: 15px;
  text-align: center; cursor: pointer; margin-top: 12px;
}

/* ── paused panel ── */
.dt-paused-panel {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 5020; pointer-events: auto; padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dt-paused-icon { font-size: 48px; margin-bottom: 16px; }
.dt-paused-title { font-size: 22px; font-weight: 700; color: #fff; text-align: center; margin-bottom: 8px; }
.dt-paused-sub { font-size: 15px; color: #aaa; margin-bottom: 32px; }
.dt-paused-continue {
  background: #2563eb; color: #fff; border: none; border-radius: 28px;
  padding: 16px 40px; font-size: 17px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.dt-paused-continue:active { background: #1d4ed8; }

/* ── step highlight ── */
.dt-active-step {
  background: rgba(66, 133, 244, 0.12) !important;
  border-left: 4px solid #4285F4 !important;
  border-radius: 4px;
}

/* ── disclaimer ── */
#dt-disclaimer {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
}
.dt-disclaimer-card {
  background: #1e2030; border: 1px solid #2a2d3e; border-radius: 20px;
  padding: 28px 24px; max-width: 360px; width: 100%; text-align: center;
  color: #e0e0e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dt-disclaimer-card h3 { margin: 0 0 14px; font-size: 20px; font-weight: 700; color: #fff; }
.dt-disclaimer-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #aaa; }
.dt-disclaimer-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.dt-disclaimer-btn { padding: 14px; border: none; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; }
.dt-disclaimer-accept { background: #2563eb; color: #fff; }
.dt-disclaimer-cancel { background: rgba(255, 255, 255, 0.08); color: #aaa; }

/* ── safe area ── */
@supports (padding-top: env(safe-area-inset-top)) {
  .dt-top-left, .dt-top-center, .dt-top-right { top: calc(16px + env(safe-area-inset-top)); }
  .dt-off-route, .dt-gps-status { top: calc(68px + env(safe-area-inset-top)); }
}
