/* Drift analytics — Ditto+ dashboard modal (separate from main bundle) */

.drift-modal-root {
  position: fixed;
  inset: 0;
  z-index: 100210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s;
}
.drift-modal-root.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.drift-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 18, 0.72);
  backdrop-filter: blur(10px);
}
.drift-modal-shell {
  position: relative;
  z-index: 1;
  width: min(96vw, 560px);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 28px 90px rgba(15, 23, 42, 0.65),
    0 0 80px rgba(99, 102, 241, 0.12);
  background: linear-gradient(165deg, #12152a 0%, #0a0c18 45%, #0f1022 100%);
}
.drift-modal-head {
  flex-shrink: 0;
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(14, 165, 233, 0.2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.drift-modal-head h2 {
  margin: 0 0 4px 0;
  font-family: Sora, sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}
.drift-modal-head h2 i {
  color: #a5b4fc;
}
.drift-modal-sub {
  margin: 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.45;
}
.drift-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
}
.drift-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.drift-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 22px;
}
.drift-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 480px) {
  .drift-stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.drift-stat-card {
  border-radius: 14px;
  padding: 12px 12px 14px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(148, 163, 184, 0.12);
  position: relative;
  overflow: hidden;
}
.drift-stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 70%);
  pointer-events: none;
}
.drift-stat-card .lab {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 6px;
}
.drift-stat-card .num {
  font-family: Sora, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #e0e7ff;
  line-height: 1.1;
}
.drift-stat-card .hint {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}
.drift-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #818cf8;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.drift-lang-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drift-lang-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #cbd5e1;
}
.drift-lang-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.drift-lang-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  min-width: 4px;
  transition: width 0.35s ease;
}
.drift-events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 420px) {
  .drift-events-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.drift-event-pill {
  border-radius: 12px;
  padding: 10px 10px 11px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(71, 85, 105, 0.45);
  text-align: center;
}
.drift-event-pill .ev-name {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
}
.drift-event-pill .ev-n {
  font-size: 18px;
  font-weight: 800;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}
.drift-loading,
.drift-err {
  text-align: center;
  padding: 36px 16px;
  color: #94a3b8;
  font-size: 13px;
}
.drift-err {
  color: #f87171;
}
.sidebar-dd-analytics .dd-analytics-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
}
