:root {
  color-scheme: light;
}

body {
  font-family: 'Inter', sans-serif;
}

.map-container {
  position: relative;
  display: inline-block;
  width: min(100%, 46rem);
  height: 340px;
}

.map-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  border-radius: 1.25rem;
}

.map-container .point {
  cursor: pointer;
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  background-color: #ef4444;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
  animation: pulse 3s infinite;
}

.map-container .map-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 12rem;
  max-width: 16rem;
  background-color: #111827;
  color: #f9fafb;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
  font-size: 0.75rem;
  line-height: 1.2;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 120ms ease-out;
  text-align: left;
}

.map-container .map-tooltip.visible {
  opacity: 1;
}

.activity-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  transition: all 0.18s ease-in-out;
}

.activity-toggle-button:hover,
.activity-toggle-button:focus-visible {
  color: #111827;
  background-color: #f3f4f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.activity-toggle-button[aria-pressed='true'] {
  background-color: #111827;
  color: #ffffff;
  border-color: #111827;
}

.activity-row {
  cursor: default;
  transition: background-color 0.16s ease-in-out;
}

.activity-row:hover,
.activity-row:focus-within {
  background-color: #f9fafb;
}

.activity-row.is-active {
  background-color: #eef2ff;
}

.activity-analytics-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #4b5563;
  transition: all 0.16s ease-in-out;
}

.activity-analytics-button i {
  width: 1rem;
  height: 1rem;
}

.activity-analytics-button:hover,
.activity-analytics-button:focus-visible {
  color: #111827;
  background-color: #f3f4f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.activity-analytics-button:focus-visible {
  border-color: #111827;
}

.activity-row.is-active .activity-analytics-button {
  background-color: #eef2ff;
  border-color: #4338ca;
  color: #312e81;
}

.activity-row.is-active .activity-analytics-button:hover,
.activity-row.is-active .activity-analytics-button:focus-visible {
  background-color: #e0e7ff;
  color: #312e81;
}

.activity-detail-row td {
  padding: 0;
  background-color: #f9fafb;
}

.activity-detail-cell {
  padding: 1.75rem;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.slide-analytics {
  margin-top: 0;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: grid;
  gap: 1.75rem;
}

.slide-analytics__header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.slide-analytics__intro {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slide-analytics__viewer-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

.slide-analytics__viewer-email {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slide-analytics__viewer-email button {
  font-weight: 500;
}

.slide-analytics__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
}

.slide-analytics__summary {
  font-size: 0.9rem;
  color: #4b5563;
  max-width: 44rem;
}

.slide-analytics__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1.5rem;
  text-align: left;
}

.slide-analytics__meta dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  margin-bottom: 0.2rem;
}

.slide-analytics__meta dd {
  margin: 0;
  font-size: 0.95rem;
  color: #111827;
}

.slide-analytics__chart {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.5rem;
  background-color: #ffffff;
  display: grid;
  gap: 1.25rem;
}

.slide-analytics__chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.slide-analytics__chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.slide-analytics__legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #047857;
}

.slide-analytics__legend-dot {
  display: inline-flex;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 9999px;
  background: linear-gradient(180deg, #10b981 0%, #34d399 100%);
}

.slide-analytics__plot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: stretch;
}

.slide-analytics__y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

.slide-analytics__grid {
  position: relative;
  border-left: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  padding: 0 0.65rem 1.5rem;
  background-image: linear-gradient(to top, rgba(209, 213, 219, 0.7) 1px, transparent 1px);
  background-size: 100% calc(100% / 4);
  background-repeat: repeat-y;
  display: flex;
  align-items: flex-end;
}

.slide-analytics__bars {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
}

.slide-analytics__bar-column {
  flex: 1 1 0;
  min-width: 2.25rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.5rem;
  align-items: end;
  text-align: center;
  color: #111827;
}

.slide-analytics__bar-value {
  font-size: 0.75rem;
  font-weight: 600;
}

.slide-analytics__bar-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.slide-analytics__bar-fill {
  width: 100%;
  height: var(--bar-height, 0%);
  background: linear-gradient(180deg, #10b981 0%, #34d399 100%);
  border-radius: 0.75rem 0.75rem 0.25rem 0.25rem;
  transition: height 180ms ease-out;
}

.slide-analytics__bar-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slide-analytics__bar-index {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.slide-analytics__bar-name {
  font-size: 0.8rem;
  color: #111827;
  font-weight: 500;
}

.slide-analytics__empty {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  padding: 1rem 0;
}

@media (max-width: 768px) {
  .activity-detail-cell {
    padding: 1.25rem;
  }

  .slide-analytics__header {
    gap: 1rem;
  }

  .slide-analytics__chart {
    padding: 1.25rem;
  }

  .slide-analytics__plot {
    grid-template-columns: 1fr;
  }

  .slide-analytics__y-axis {
    flex-direction: row;
    justify-content: space-between;
    padding: 0;
  }

  .slide-analytics__grid {
    height: 220px;
  }
}

@media (min-width: 768px) {
  .slide-analytics__header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .slide-analytics__intro {
    max-width: 30rem;
  }

  .slide-analytics__meta {
    max-width: 38rem;
  }

  .slide-analytics__grid {
    min-height: 240px;
  }
}

.range-toggle-group {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 9999px;
  background-color: #f3f4f6;
  gap: 0.25rem;
}

.range-toggle-button {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: all 0.16s ease-in-out;
}

.range-toggle-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
}

.range-toggle-button:hover {
  color: #111827;
}

.range-toggle-button.is-active {
  background-color: #ffffff;
  color: #111827;
  border-color: #d1d5db;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}

.visit-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 9rem;
  background-color: #111827;
  color: #f9fafb;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.15);
  font-size: 0.75rem;
  line-height: 1.3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -140%);
  transition: opacity 140ms ease-out, visibility 140ms ease-out, transform 140ms ease-out;
  z-index: 10;
  will-change: transform, opacity;
}

.visit-tooltip p {
  margin: 0;
}

.visit-tooltip p + p {
  margin-top: 0.15rem;
  color: #d1d5db;
}

.visit-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.visit-dot {
  pointer-events: none;
}

.visit-dot__target {
  pointer-events: auto;
  cursor: pointer;
  fill: transparent;
  stroke: transparent;
  transition: transform 160ms ease-out;
}

.visit-dot__target:focus-visible {
  outline: none;
  stroke: rgba(59, 130, 246, 0.45);
  stroke-width: 2px;
}

.visit-dot__point {
  fill: #be185d;
  stroke: #ffffff;
  stroke-width: 2px;
  pointer-events: none;
  transition: transform 160ms ease-out, fill 160ms ease-out, stroke 160ms ease-out;
}

.visit-dot__target:hover + .visit-dot__point,
.visit-dot__target:focus-visible + .visit-dot__point {
  transform: scale(1.12);
  fill: #db2777;
  stroke: #1f2937;
}

[data-visit-chart] svg polygon,
[data-visit-chart] svg polyline,
[data-visit-chart] svg line {
  pointer-events: none;
}

.engagement-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  min-width: 3.25rem;
  padding-inline: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  background-color: #f3f4f6;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #4b5563;
  text-transform: uppercase;
}

.os-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: #f3f4f6;
  color: #111827;
}

.os-icon svg {
  width: 1rem;
  height: 1rem;
}

.os-icon-mac {
  background-color: #f5f5f5;
}

.os-icon-android {
  background-color: #ecfdf5;
  color: #047857;
}

.os-icon-windows {
  background-color: #eff6ff;
  color: #1d4ed8;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.status-pill[data-status='Investor'] {
  background-color: #ecfdf5;
  color: #047857;
}

.status-pill[data-status='Partner'] {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.status-pill[data-status='Internal'] {
  background-color: #f5f3ff;
  color: #6d28d9;
}

.badge-active {
  background-color: #ecfeff;
  color: #0f172a;
}

.badge-draft {
  background-color: #f5f3ff;
  color: #3730a3;
}

.badge-archived {
  background-color: #fef2f2;
  color: #991b1b;
}

.dropdown-menu {
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}

.sortable-ghost {
  opacity: 0.4;
  background-color: #e0e7ff;
  border: 2px dashed #6366f1;
}

.header-item h3,
.header-row td {
  pointer-events: none;
}

.document-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #ffffff;
}

.document-table thead {
  background: linear-gradient(90deg, #0f172a 0%, #1f2937 100%);
  color: #f9fafb;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.document-table th,
.document-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  vertical-align: middle;
}

.document-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.document-table tbody tr:hover {
  background-color: #eef2ff;
}
