* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #map { width: 100%; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; background: #0f172a; color: #0f172a; }

.hidden { display: none !important; }

.wind-overlay {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 5;
}

/* Search Panel */
.search-panel {
  position: fixed; top: 14px; left: 14px; width: 360px; max-width: calc(100vw - 28px);
  z-index: 20;
}
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.96); border: 1px solid #cbd5e1;
  border-radius: 12px; padding: 6px 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}
.brand-badge {
  background: #0f172a; color: #facc15; font-weight: 800; font-size: 12px;
  padding: 4px 8px; border-radius: 7px; letter-spacing: 0.4px;
}
.search-box input {
  flex: 1; border: none; outline: none; font-size: 13.5px; background: transparent; color: #0f172a;
}
.icon-btn {
  border: none; background: transparent; cursor: pointer; font-size: 18px; color: #64748b; padding: 0 4px;
}
.search-results {
  list-style: none; margin-top: 6px; background: #ffffff; border: 1px solid #cbd5e1;
  border-radius: 10px; max-height: 260px; overflow-y: auto; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
}
.search-results li {
  padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.search-results li:hover { background: #eff6ff; }
.search-results small { display: block; color: #64748b; font-size: 11px; margin-top: 2px; }
.route-hint {
  margin-top: 6px; display: inline-block; background: rgba(15, 23, 42, 0.78); color: #e2e8f0;
  font-size: 11px; padding: 4px 9px; border-radius: 8px; backdrop-filter: blur(6px);
}

/* Toolbar */
.toolbar {
  position: fixed; top: 14px; right: 14px; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 60vw;
}
.pill {
  border: 1px solid #cbd5e1; background: rgba(255, 255, 255, 0.94); color: #0f172a;
  padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12); transition: 0.15s ease;
}
.pill:hover { background: #f8fafc; transform: translateY(-1px); }
.pill.active { background: #0f172a; color: #f8fafc; border-color: #0f172a; }
.pill.accent { background: #2563eb; color: #ffffff; border-color: #1d4ed8; }
.pill.danger { background: #dc2626; color: #ffffff; border-color: #b91c1c; }

/* Operations Drawer */
.ops-drawer {
  position: fixed; top: 62px; right: 14px; width: 356px; max-height: calc(100vh - 82px);
  background: rgba(255, 255, 255, 0.97); border: 1px solid #cbd5e1; border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22); z-index: 20;
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); background: #f1f5f9; border-bottom: 1px solid #e2e8f0;
}
.tab-btn {
  border: none; background: transparent; padding: 10px 4px; font-size: 11.5px; font-weight: 700;
  color: #475569; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab-btn.active { color: #1d4ed8; border-bottom-color: #2563eb; background: #ffffff; }
.tab-pane { display: none; padding: 12px; overflow-y: auto; flex: 1; }
.tab-pane.active { display: block; }
.tab-pane h3 { font-size: 14px; margin-bottom: 8px; color: #0f172a; }
.muted-note { font-size: 11.5px; color: #475569; margin-bottom: 8px; line-height: 1.35; }

.field-row { margin-bottom: 8px; }
.field-row label, .grid-2 label {
  display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 600; color: #334155;
}
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 7px; padding: 6px 8px; font-size: 12.5px; background: #ffffff;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 6px !important; padding-top: 16px; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; font-size: 12px; }
.check-grid label { display: flex; align-items: center; gap: 5px; cursor: pointer; }

.btn-row { display: flex; gap: 6px; margin: 8px 0; }
.primary-btn, .secondary-btn {
  flex: 1; border: none; border-radius: 8px; padding: 8px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.primary-btn { background: #2563eb; color: #ffffff; }
.primary-btn:hover { background: #1d4ed8; }
.secondary-btn { background: #e2e8f0; color: #0f172a; }
.secondary-btn:hover { background: #cbd5e1; }
.full-btn { width: 100%; margin: 6px 0; }

.info-card {
  margin-top: 8px; padding: 9px 10px; border-radius: 9px; font-size: 12px; line-height: 1.4;
  background: #f8fafc; border: 1px solid #e2e8f0;
}
.info-card.verdict-fit { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.info-card.verdict-caution { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.info-card.verdict-block { background: #fef2f2; border-color: #ef4444; color: #991b1b; }

.compact-list { list-style: none; margin-top: 8px; max-height: 200px; overflow-y: auto; }
.compact-list li {
  padding: 6px 8px; border-bottom: 1px solid #f1f5f9; font-size: 11.5px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.compact-list li:hover { background: #f1f5f9; }

.queue-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.queue-item {
  border: 1px solid #cbd5e1; border-radius: 9px; padding: 8px; background: #ffffff; font-size: 11.5px;
}
.queue-item pre {
  background: #f8fafc; padding: 5px; border-radius: 5px; overflow-x: auto; font-size: 10.5px; margin: 5px 0;
}

/* Bottom-Left Real-Time Driver Speed Sign & Road Rules HUD */
.speed-hud {
  position: fixed; left: 14px; bottom: 18px; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: rgba(15, 23, 42, 0.9); color: #f8fafc;
  padding: 10px 14px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px); min-width: 290px;
}
.speed-sign {
  width: 54px; height: 54px; border-radius: 50%;
  background: #ffffff; color: #0f172a; border: 6px solid #dc2626;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; flex-shrink: 0;
}
.hud-road { font-size: 13.5px; font-weight: 700; color: #ffffff; }
.hud-sub { font-size: 11.5px; color: #cbd5e1; margin-top: 2px; }
.hud-alert {
  margin-top: 4px; display: inline-block; background: #dc2626; color: #ffffff;
  font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 5px; letter-spacing: 0.3px;
}

/* WebGL2 360 Street View Modal */
.sv-modal {
  position: fixed; inset: 24px; z-index: 50; background: #020617;
  border-radius: 14px; border: 1px solid #334155; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}
.sv-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #0f172a; color: #f8fafc; font-weight: 700; font-size: 13px;
}
.sv-controls { display: flex; align-items: center; gap: 8px; }
.sv-badge { background: #1e293b; color: #38bdf8; padding: 4px 9px; border-radius: 8px; font-size: 11.5px; }
.sv-canvas { flex: 1; width: 100%; height: 100%; cursor: grab; display: block; }
.sv-canvas:active { cursor: grabbing; }
.sv-footer {
  padding: 6px 14px; background: #0f172a; color: #94a3b8; font-size: 11px; text-align: center;
}

/* Secure Development Login Gate */
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(circle at 20% 20%, rgba(30,58,138,0.92), rgba(15,23,42,0.97));
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.login-card {
  width: 100%; max-width: 380px; background: #ffffff;
  border-radius: 16px; padding: 24px 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.login-sub { font-size: 12px; font-weight: 600; color: #64748b; }
.login-card h2 { margin: 0 0 6px; font-size: 20px; color: #0f172a; }
.login-error {
  margin-bottom: 10px; padding: 8px 10px; border-radius: 8px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  font-size: 12px; font-weight: 600;
}

/* Start & End Destination Route Planner */
.route-planner {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 8px; margin-bottom: 10px;
}
.route-input-wrap {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.route-input-wrap input {
  flex: 1; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 7px;
  font-size: 12px; background: #fff; outline: none;
}
.route-input-wrap input:focus { border-color: #2563eb; }
.route-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; color: #fff;
}
.route-dot.start { background: #16a34a; }
.route-dot.end { background: #dc2626; }
.mini-btn {
  width: 28px; height: 28px; border: 1px solid #cbd5e1; border-radius: 7px;
  background: #fff; color: #334155; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.mini-btn:hover { background: #eff6ff; color: #1d4ed8; }
.inline-results {
  list-style: none; margin: -2px 0 6px; padding: 0; max-height: 150px; overflow-y: auto;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
  box-shadow: 0 6px 16px rgba(15,23,42,0.12);
}
.inline-results li {
  padding: 6px 8px; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-size: 12px;
}
.inline-results li:hover { background: #eff6ff; }
.inline-results li small { display: block; color: #64748b; font-size: 10.5px; }

/* Vehicle Fit Road Highlight Legend */
.fit-legend {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; padding: 6px 8px; border-radius: 8px;
  background: #f1f5f9; border: 1px solid #cbd5e1; font-size: 11px; font-weight: 600; color: #334155;
}
.fit-legend span { display: inline-flex; align-items: center; gap: 4px; }
.fit-legend .swatch {
  display: inline-block; width: 12px; height: 4px; border-radius: 2px;
}
.fit-legend .swatch.fit { background: #16a34a; }
.fit-legend .swatch.caution { background: #f59e0b; }
.fit-legend .swatch.unsuitable { background: #cbd5e1; border: 1px solid #94a3b8; }
.fit-legend .swatch.blocked { background: #dc2626; }
