html,
body {
  overscroll-behavior: none;
}

/* .html-table-wrapper, .html-table-wrapper-value-col {
  overscroll-behavior: auto;
} */

.main-container {
  font-family: "Inter", sans-serif;
  width: 100%;
  max-width: 100%;
}

.loading-message {
  text-align: center;
  padding: 4rem;
  font-size: 1.2rem;
  color: #6b7280;
}

.section {
  padding-bottom: 2rem;
}

.section + .section {
  border-top: 1px solid #e5e7eb;
  padding-top: 2rem;
}

.section[style*="display: none"] + .section {
  border-top: 0px;
}

.section-header {
  margin-bottom: 2rem;
}

.section-title-container {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  font-family: "Poppins", sans-serif;
}

.section-subtitle,
.section-date {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0.25rem 0;
}

.section-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.section-controls:not(:has(*)) {
  display: none;
}

.section-header:has(.section-controls:empty) {
  margin-bottom: 1rem;
}

.chart-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

.chart-grid-pair {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

.chart-grid-single {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

.chart-grid-quad {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

.chart-grid-quad > .chart-card {
  justify-content: space-between;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chart-card-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.chart-card-title:has(.chart-controls:not(:empty)) {
  flex-direction: column;
}

.chart-card-title:has(.chart-controls:not(:empty)) .chart-controls {
  width: 100%;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .chart-card-title:has(.chart-controls:not(:empty)) {
    flex-direction: row;
  }

  .chart-card-title:has(.chart-controls:not(:empty)) .chart-controls {
    width: auto;
    flex-wrap: nowrap;
  }
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.chart-title-text {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 0 1 auto;
}

.section-title > a {
  display: inline-flex;
}

.section-title > a::after {
  content: "";
  display: inline-block;
  width: 15px;
  min-width: 15px;
  height: 15px;
  min-height: 15px;
  margin-left: 5px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"></path></svg>');
  background-size: contain;
  background-repeat: no-repeat;
}

.chart-title-text > a {
  display: inline-flex;
}

.chart-title-text > a::after {
  content: "";
  display: inline-block;
  width: 13px;
  min-width: 13px;
  height: 13px;
  min-height: 13px;
  margin-left: 5px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"></path></svg>');
  background-size: contain;
  background-repeat: no-repeat;
}

.chart-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.chart-stats {
  display: flex;
  flex-direction: column;
  /* margin: 0rem 0 1rem 0; */
  font-size: 1.25rem;
  font-family: "Poppins", sans-serif;
  gap: 0.2rem;
}

.stat-date {
  display: inline-block;
  font-size: 0.875rem;
  color: rgb(113, 113, 122);
  margin: 0;
  min-height: 1.2em;
}

.stat-value {
  font-weight: 500;
  font-family: "Poppins", sans-serif;
  margin: 0.25rem 0 0 0;
}

.chart-canvas-container {
  position: relative;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

/*
 * Generic sizing hooks for chart-canvas-container, driven by inline
 * `--canvas-*` custom properties set from ChartConfig fields (canvas_width,
 * canvas_min_width, etc. in schema.py) via chart_card.j2. Undeclared
 * properties fall back to `initial`/`none`, so containers without these
 * fields keep their existing size (no behavior change).
 */
.chart-canvas-container {
  width: var(--canvas-width, 100%);
  height: var(--canvas-height, 300px);
  min-width: var(--canvas-min-width, 0);
  min-height: var(--canvas-min-height, auto);
  max-width: var(--canvas-max-width, none);
  max-height: var(--canvas-max-height, none);
  aspect-ratio: var(--canvas-aspect-ratio, auto);
  margin: 0 auto;
}

/* Any single-chart section can overflow-scroll if its content (e.g. a wide
   heatmap) doesn't fit, instead of requiring a bespoke :has() rule per class. */
.chart-grid-single {
  overflow-x: auto;
}

.table-container {
  min-width: 0;
  max-width: 100%;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2.5rem 0 1rem 0;
}

.slider-label {
  font-size: 0.9rem;
  text-align: center;
  min-width: 70px;
  flex-shrink: 0;
}

.slider-noui {
  flex-grow: 1;
}

.noUi-target {
  background: #e2e8f0;
  border: none;
  box-shadow: none;
  height: 0.5rem;
}
.noUi-connect {
  background: #94a3b8;
  transition: background-color 0.15s ease-in-out;
}
.noUi-handle {
  border: 2px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  width: 1.5rem !important;
  height: 1.5rem !important;
  right: -0.75rem !important;
  top: -0.5rem !important;
  cursor: grab;
  transition: border-color 0.15s ease-in-out;
}
.noUi-handle::before,
.noUi-handle::after {
  display: none;
}
.noUi-handle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.noUi-tooltip {
  border: none;
  background: #18181b;
  color: white;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 4px;
  bottom: 150% !important;
}
.noUi-tooltip {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s ease-in-out,
    visibility 0.15s ease-in-out;
}
.slider-noui:hover .noUi-tooltip,
.noUi-handle.noUi-active .noUi-tooltip {
  opacity: 1;
  visibility: visible;
}

.slider-noui:hover .noUi-connect,
.noUi-handle.noUi-active .noUi-connect {
  background: #2563eb;
}
.slider-noui:hover .noUi-handle,
.noUi-handle.noUi-active {
  border-color: #2563eb;
}

.dropdown-container {
  position: relative;
  font-size: 0.875rem;
  max-width: 100%;
  min-width: 0;
}
.dropdown-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  padding: 6px 12px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  text-align: left;
  cursor: pointer;
  outline: none;
  font-weight: 500;
  max-width: 100%;
  min-width: 0;
}
.dropdown-button:focus-visible {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.dropdown-button-incard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  padding: 4px 8px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  text-align: left;
  cursor: pointer;
  outline: none;
  font-weight: 500;
  font-size: 0.7rem;
  max-width: 100%;
  min-width: 0;
}
.dropdown-button-incard:focus-visible {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}
.dropdown-label {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.dropdown-prefix {
  font-weight: 500;
  margin-right: 0.5rem;
  color: #4b5563;
  flex-shrink: 0;
}
.dropdown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.375rem;
  background-color: #2563eb;
  color: white;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.dropdown-button svg,
.dropdown-button-incard svg {
  flex-shrink: 0;
}
.dropdown-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: max-content;
  max-width: calc(100vw - 2rem);
  max-height: 240px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  font-size: 0.875rem;
  /* Typography is declared here, not inherited: with `portal` the panel is
     moved to document.body, whose only font-family ancestor rules live on
     .main-container / .dt-container. Inheriting would drop it to the UA
     default the moment it is portaled. */
  font-family: "Inter", sans-serif;
  color: #1f2937;
  line-height: 1.5;
}
.dropdown-options-incard {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: max-content;
  max-width: calc(100vw - 2rem);
  max-height: 240px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  font-size: 0.75rem;
  /* Typography is declared here, not inherited: with `portal` the panel is
     moved to document.body, whose only font-family ancestor rules live on
     .main-container / .dt-container. Inheriting would drop it to the UA
     default the moment it is portaled. */
  font-family: "Inter", sans-serif;
  color: #1f2937;
  line-height: 1.5;
}
/* The panel while it is portaled into document.body (see `portal` in
   dropdown.js). It sits in the root stacking context, so it clears sticky
   chrome and any clipped ancestor the control itself lives in. Position,
   size and display come from inline styles set at open time. */
.dropdown-portaled {
  z-index: 1000;
}

.dropdown-container.open .dropdown-options {
  display: block;
}
.dropdown-container.open .dropdown-options-incard {
  display: block;
}
.dropdown-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.dropdown-option:hover,
.dropdown-option:focus {
  background-color: #f3f4f6;
}
.dropdown-option[aria-selected="true"] {
  font-weight: 500;
}
.dropdown-option-label {
  flex-grow: 1;
  white-space: normal;
  overflow-wrap: break-word;
}
.dropdown-option-check {
  color: #2563eb;
}
.dropdown-option-checkbox {
  width: 1rem;
  height: 1rem;
  border-color: #d1d5db;
  border-radius: 0.25rem;
  pointer-events: none;
}
.dropdown-option-checkbox:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}
.dropdown-search-wrapper {
  padding: 4px;
  border-bottom: 1px solid #e5e7eb;
}
.dropdown-search {
  width: 100%;
  padding: 6px 8px;
  border: 0px;
  border-radius: 0.25rem;
  outline: none;
  font: inherit;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23a0a3a7' aria-hidden='true' data-slot='icon' class='h-4 w-4' width='16' height='16'><path fill-rule='evenodd' d='M3.647 3.647a.5.5 0 0 1 .707 0L8 7.293l3.647-3.647a.5.5 0 1 1 .707.707L8.707 8l3.647 3.647a.5.5 0 1 1-.707.707L8 8.707l-3.647 3.647a.5.5 0 0 1-.707-.707L7.293 8 3.647 4.353a.5.5 0 0 1 0-.707' clip-rule='evenodd'/></svg>");
  cursor: pointer;
}

/* Deliberately plain: a small hairline ring in interface grey, closer to the
   browser's own throbber than to anything of ours. A tapered arc over a faint
   track, both clipped to the ring by the mask, so the stroke stays 2px. */
.spinner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, rgba(113, 113, 122, 0), rgba(113, 113, 122, 1)),
    linear-gradient(#f4f4f5, #f4f4f5);
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 2px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 2px)
  );
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Still turning — a frozen spinner reads as a hung page — just slowly enough
   not to draw the eye. */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

.error-message {
  margin: auto;
  padding: 1rem;
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

/* Stands in for the whole dashboard when its data cannot be fetched, so it
   carries the retry rather than only the bad news. The button is the one from
   the catalogue's empty state. */
.dashboard-load-error {
  padding: 4rem 1rem;
  text-align: center;
  color: #6b7280;
}

.dashboard-load-error-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.dashboard-load-error-detail {
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.catalogue-root {
  display: flex;
  flex-direction: column;
}

.catalogue-header {
  margin-bottom: 1.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.catalogue-search-wrapper {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 0.5rem;
}

.search-icon {
  color: #9ca3af;
  pointer-events: none;
}

.catalogue-search-input {
  width: 100%;
  border: none;
  font-size: 1rem;
  outline: none;
  color: #71717a;
  padding: 0.375rem 0.75rem;
}

.search-clear {
  background: none;
  border: none;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  color: #71717a;
}

.search-clear:hover {
  background: #f1f5f9;
  color: #71717a;
}

.search-clear.hidden {
  display: none;
}

.clear-btn-text {
  display: none;
  margin: 0;
}

.catalogue-tabs {
  display: flex;
  justify-content: left;
  gap: 0.5rem;
  padding-bottom: 1.5rem;
  flex-wrap: nowrap;
}

.catalogue-tab {
  padding: 0.5rem 0.8rem;
  border: 0px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.catalogue-tab:hover {
  background-color: #c5c5c5;
}
.catalogue-tab.active {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
  border-width: 1px;
}

.catalogue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 3rem;
}

/* Stand-ins for anything that only arrives with the JSON: catalogue cards, the
   category tabs above them, the stats each dashboard opens with. Every bar is
   sized to what replaces it, so nothing shifts when the data lands. */
.skeleton-line {
  display: block;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.card-skeleton {
  pointer-events: none;
}

/* The real body stacks a title over a description; the bars need the gap
   spelled out. */
.card-skeleton .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-category {
  width: 45%;
  height: 0.75rem;
}

.skeleton-title {
  width: 80%;
  height: 1rem;
}

.skeleton-description {
  width: 100%;
  height: 0.875rem;
}

.skeleton-description-short {
  width: 60%;
  height: 0.875rem;
}

.skeleton-footer {
  width: 35%;
  height: 0.75rem;
}

.skeleton-stat-value {
  width: 6rem;
  height: 1.5rem;
}

.skeleton-stat-date {
  width: 3.5rem;
  height: 0.75rem;
}

/* Uneven widths, as a row of category names would be. */
.skeleton-tab {
  width: 6rem;
  height: 2.25rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.skeleton-tab:nth-child(3n + 2) {
  width: 7.5rem;
}

.skeleton-tab:nth-child(3n) {
  width: 5rem;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line {
    animation: none;
  }
}

.catalogue-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  /* Named rather than `all`: the card's own layout properties are animated by
     nothing, and `all` would pick up any future one. */
  transition:
    background-color 0.2s ease-in-out,
    border-color 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
  background-color: #fff;
  padding: 1.5rem;
}
.catalogue-card:hover {
  background-color: #f8fafc;
}
/* The card is a link, so keyboard users land on it with no pointer to give the
   hover state; the reveals below are keyed to both from here on. */
.catalogue-card:focus-visible {
  background-color: #f8fafc;
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.card-redirect-icon {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 1.25rem;
  height: 1.25rem;
  color: #9ca3af;
  opacity: 0;
  transform: translateY(0.25rem);
  transition:
    opacity 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}
.catalogue-card:hover .card-redirect-icon,
.catalogue-card:focus-visible .card-redirect-icon {
  opacity: 1;
  transform: translateY(0);
}
/* The icon takes its size from the box above, so cards can scale it. */
.card-redirect-icon svg {
  width: 100%;
  height: 100%;
}

.card-category {
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  display: inline-block;
  text-transform: uppercase;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: black;
  padding-bottom: 0.5rem;
}
.card-body {
  flex-grow: 1;
}
.card-description {
  font-size: 0.875rem;
  font-weight: 500;
  color: black;
  line-height: 1.5;
}
/* The date and the prompt sit side by side rather than swapping: how current
   the data is matters most at the moment someone is deciding to open the card,
   so the prompt rises in beside it instead of taking its place. The prompt is
   in the flow at all times, so the card's height never moves; min-height holds
   the row open on a card with no date. */
.card-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}
.card-footer-date {
  min-width: 0;
}
.card-footer-cta {
  /* Holds the right edge whether or not a date is present. */
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(0.375rem);
  color: #2563eb;
  font-weight: 600;
  transition:
    opacity 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}
.catalogue-card:hover .card-footer-cta,
.catalogue-card:focus-visible .card-footer-cta {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .catalogue-card,
  .card-redirect-icon,
  .card-footer-cta {
    transition: none;
    transform: none;
  }
}
.catalogue-empty {
  text-align: center;
  grid-column: 1 / -1;
  padding: 3rem;
  color: #6b7280;
}

/* An empty result and a failed load are both dead ends without the way out
   underneath them: back to the full list, or another attempt at the fetch. */
.catalogue-empty-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.catalogue-empty-detail {
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.catalogue-empty-action {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: #fff;
  color: #111827;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}

.catalogue-empty-action:hover {
  background-color: #f8fafc;
  border-color: #9ca3af;
}

.catalogue-empty-action:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.chart-stats-container {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
  margin: 0rem 0 1rem 0;
  justify-content: stretch;
  flex-grow: 1;
}

.stat-item {
  display: inline-block;
  margin-left: 0.5rem;
  text-align: right;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.125rem;
}

.stat-item-header {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  font-weight: 600;
  color: rgb(113, 113, 122);
}

.stat-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-row-single {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}
.stat-value {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.2;
}

.stat-callout {
  display: inline;
  font-size: 1.125rem;
  font-weight: 500;
}

.stat-date-inline {
  font-size: 0.875rem;
  color: #9ca3af;
  font-weight: 400;
}

.stat-date-complex {
  font-size: 0.875rem;
  color: #9ca3af;
  font-weight: 400;
}

.stats-section {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}
.stats-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  padding: 1rem 0;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: #f3f4f6;
  color: #4b5563;
}
.stat-icon-wrapper svg {
  width: 1.5rem;
  height: 1.5rem;
}
.stat-details {
  display: flex;
  flex-direction: column;
}
.stat-title-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s ease-in-out;
}
.stat-title-link:hover {
  color: #111827;
  text-decoration: underline;
}
.stat-title-link svg {
  width: 1rem;
  height: 1rem;
}
.stat-value-large {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}
.stat-date-small {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
}

.hero-container {
  padding: 3rem;
  position: relative;
}

.hero-logo {
  position: absolute;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: none;
  fill-opacity: 0.1;
}

/* Bar Meter Wrapper */
.barmeter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* space-y-3 */
  width: 100%;
}

.barmeter-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* space-y-2 */
}

.barmeter-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem; /* text-sm */
}

.barmeter-value {
  color: #6b7280; /* text-dim */
  display: flex;
  gap: 0.25rem;
}

.barmeter-track {
  background-color: #f3f4f6; /* bg-washed */
  height: 0.75rem; /* h-3 */
  width: 100%;
  border-radius: 9999px;
  overflow: hidden;
}

.barmeter-fill {
  background-color: #111827; /* bg-black */
  height: 100%;
  border-radius: 9999px;
  width: 0;
  transition: width 1s ease-out; /* Animation */
}

/* Vertical Layout */
.barmeter-vertical {
  flex-direction: row;
  justify-content: space-around;
  height: 400px;
  align-items: flex-end;
}

.barmeter-vertical .barmeter-item {
  height: 100%;
  width: 2rem;
  align-items: center;
  justify-content: flex-end;
}

.barmeter-vertical .barmeter-track {
  height: 80%;
  width: 1.5rem;
  display: flex;
  align-items: flex-end; /* Grow from bottom */
}

.barmeter-vertical .barmeter-fill {
  width: 100%;
  height: 0;
  transition: height 1s ease-out;
}

.dt-container {
  font-family: "Inter", sans-serif;
  color: #1f2937;
  margin: 0 auto;
}

.dt-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dt-preview-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dt-preview-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.dt-preview-canvas {
  width: 100%;
  height: 100px; /* Small height for previews */
}

/* Controls */
.dt-control-wrapper {
  display: flex;
  justify-content: end;
  align-items: center;
  margin-bottom: 1rem;
}

.dt-controls {
  display: flex;
  justify-content: end;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #e5e7eb;
}

.dt-search {
  padding: 0.5rem 1rem;
  border: 0px;
  font-size: 0.875rem;
}

.dt-search:focus {
  outline: none;
}

/* Table Styles */
.dt-table-wrapper {
  overflow-x: auto;
}

.dt-faded {
  opacity: 0;
}

.dt-table {
  width: fit-content;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 0.875rem;
  margin-left: auto;
  margin-right: auto;
}

.dt-table th {
  font-weight: 500;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid #e3e8f0;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.dt-table th:hover {
  background-color: #f3f4f6;
}

.dt-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e3e8f0;
  color: #111827;
}

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

.dt-table tr:last-child td {
  border-bottom: none;
}

/* Alignment Classes */
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Pagination */
.dt-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.dt-btn {
  display: flex;
  padding: 0.375rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
  gap: 0.375rem;
  align-items: center;
}

.dt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e5e7eb;
}

.sort-icon {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.75rem;
  color: #9ca3af;
}

.dt-main-view {
  min-height: 500px;
  background: white;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  position: relative;
}

/* Selector Row */
.dt-selectors {
  display: flex;
  justify-content: start;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.dt-select-card-wrapper {
  display: flex;
  flex-direction: column;
}

.dt-selector-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: white;
  padding: 0.5rem;
  cursor: pointer;
  min-width: 150px;
  width: 200px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dt-selector-card:hover {
  background-color: #f9fafb;
}

.dt-selector-card.active {
  border-color: #2563eb;
}

.dt-selector-title {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  text-align: center;
}

/* Icons & Previews */
.dt-icon-table {
  width: 6rem;
  height: 6rem;
  color: #4b5563;
  stroke-width: 1.5px;
}

.dt-preview-canvas {
  width: 100%;
  height: 94px; /* Tiny height for selector */
  pointer-events: none; /* Disable tooltip interaction on previews */
}

/* Main Chart Slider Specifics */
.dt-chart-wrapper {
  padding: 1rem;
  height: 400px; /* Fixed height for main chart */
  position: relative;
}

.dt-slider-wrapper {
  margin-top: 1rem;
  padding: 0 1rem;
}

.dt-slider-wrapper {
  margin-top: 1.5rem;
  padding: 0 1rem;
  width: 100%;
}

.table-button {
  width: 18px;
  height: 18px;
}

.table-search {
  color: #71717a;
  width: 18px;
  height: 18px;
}

.dt-global-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.section-tabs {
  flex-grow: 1;
  display: flex;
  max-width: 100%;
  overflow-x: scroll;
  padding-bottom: 0.5rem;
  white-space: nowrap;
}

.section-tab {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280; /* Gray-500 */
  background-color: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.section-tab:hover {
  color: #111827;
}

.section-tab.active {
  background-color: #e5e7eb; /* Gray-200 */
  color: #111827;
}

.dashboard-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
}

.tabs-container {
  display: flex;
  overflow-x: auto;
  justify-content: flex-start;
}

.tab-item {
  padding: 1rem 1.5rem;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.tab-label {
  font-size: 1rem;
  font-weight: 500;
  color: #6b7280;
  transition: color 0.2s;
}

.tab-item:hover .tab-label {
  color: #111827;
}

.tab-item.active .tab-label {
  color: #111827;
}

.tab-item.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #2563eb;
}

.table-title-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 2rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin-bottom: 0.5rem;
}

.table-title-container .table-title {
  margin-top: 0;
  padding-left: 0;
  margin-bottom: 0;
}

.table-date {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.table-title {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  padding-left: 0.75rem;
  margin-top: 2rem;
}

.simple-html-table-wrapper {
  position: relative;
  width: fit-content;
  max-width: 100%;
  overflow: auto;
  /* border: 1px solid #e5e7eb; */
  /* border-radius: 0.5rem; */
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
}

.simple-html-table {
  /* width: 100%; */
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.875rem;
  color: #111827;
}

.simple-html-table thead {
  position: sticky;
  top: 0;
  background-color: #f9fafb;
  z-index: 1;
}

.simple-html-table th,
.simple-html-table td {
  padding: 0.5rem 1.25rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  overflow-wrap: normal;
  white-space: wrap;
  min-width: 8rem;
}

.simple-html-table th {
  border-top: 1px solid #e5e7eb;
}

.simple-html-table-col-first-header {
  text-align: left;
}

.simple-html-table-col-header {
  text-align: right;
}

/* .simple-html-table-first-col {
  padding-right: 2rem;
}

.simple-table-index {
  padding-right: 2rem;
} */

.simple-table-values {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  text-align: right;
}

.html-table-wrapper {
  position: relative;
  width: 100%;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

.html-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  color: #111827;
}

.html-table thead {
  position: sticky;
  top: 0;
  background-color: #f9fafb;
  z-index: 1;
}

.html-table th,
.html-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  overflow: hidden;
  overflow-wrap: normal;
  white-space: wrap;
}

.html-table-wrapper th:first-child:not(.html-table-col-first-slim-header) {
  position: sticky;
  left: 0;
  background-color: #f9fafb;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  overflow: hidden;
  overflow-wrap: break-word;
  white-space: wrap;
}
.html-table-first-col {
  position: sticky;
  left: 0;
  background-color: #ffffff;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  overflow: hidden;
  overflow-wrap: break-word;
  white-space: wrap;
}

.html-table-wrapper-value-col {
  width: 125px;
  min-width: 125px;
  max-width: 125px;
}

.html-table-wrapper-value-col:not(.html-table-col-other-slim) {
  justify-items: center;
}

.html-table-col-first-slim-header {
  position: sticky;
  left: 0;
  background-color: #f9fafb;
}

.html-table-col-first-slim-header-ns {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
}

.html-table-col-slim-header {
  /* width: 100px; */
  min-width: 60px;
  max-width: 100px;
  overflow: hidden;
  overflow-wrap: break-word;
  white-space: wrap;
}

.html-table-col-first-slim {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

.html-table-col-other-slim {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.table-index {
  z-index: 19;
}

.html-table-wrapper
  th:nth-child(n + 2):not(
    .html-table-col-first-slim-header,
    .html-table-col-slim-header
  ) {
  justify-items: center;
}

.html-table-header-var {
  width: 95px;
}

.table-values {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  display: flex;
  gap: 0.15rem;
  align-items: baseline;
}

.table-values:not(.html-table-col-other-slim > *) {
  width: 95px;
}

.html-table-wrapper th:nth-last-child(2):not(.html-table-col-slim-header),
.html-table-wrapper td:nth-last-child(2):not(.html-table-col-other-slim) {
  border-left: 1px solid #e5e7eb;
}

.html-table-wrapper th:first-child:not(.html-table-col-slim-header),
.html-table-wrapper td:first-child:not(.html-table-wrapper-value-col) {
  border-right: 1px solid #e5e7eb;
}

.html-table th {
  font-weight: 600;
  color: #374151;
}

.html-table tbody tr:last-child td {
  border-bottom: none;
}

.html-table .previous-value {
  color: #6b7280;
  font-size: 0.85em;
}

.dashboard-tabs + .section {
  padding-top: 2rem;
}

.dashboard-tabs + .section + .section {
  border-top: 0px;
  padding-top: 2rem;
}

.pos_num {
  color: #00a63e;
}

.neg_num {
  color: #dc2626;
}

.mpc_legend_container {
  justify-content: center;
}

.page-template-index {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.user-analytic-heatmap {
  height: 100%;
  width: 100%;
  margin: auto;
  min-width: 1000px;
  min-height: 700px;
}
.chart-grid-single:has(.user-analytic-heatmap) {
  overflow-x: scroll;
}
.epf-heatmap {
  height: 100%;
  width: 100%;
  margin: auto;
  min-width: 1500px;
  min-height: 1000px;
}

.chart-grid-single:has(.epf-heatmap) {
  overflow-x: scroll;
}

.tooltip-icon {
  position: relative;
  display: inline-block;
  /* margin-left: 6px; */
  cursor: help;
  color: #999;
  vertical-align: middle;
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1a1a1a;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 250px;
  width: max-content;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.5;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.tooltip-icon:hover::after {
  opacity: 1;
}

@media (min-width: 768px) {
  .chart-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .chart-grid-pair {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .chart-grid-quad {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-logo {
    display: block;
  }
  .html-table-wrapper th:first-child:not(.html-table-col-first-slim-header) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
  }
  .html-table-first-col:not(.html-table-col-first-slim) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
  }
  .clear-btn-text {
    display: block;
  }
  .search-clear {
    border-radius: 0.365rem;
  }
  /* .tabs-container {
    justify-content: center;
  } */
}

@media (min-width: 1024px) {
  .chart-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .chart-grid-quad {
    grid-template-columns: repeat(4, 1fr);
  }
  .catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero-logo {
    display: block;
  }
  .html-table-wrapper th:first-child:not(.html-table-col-first-slim-header) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }
  .html-table-first-col:not(.html-table-col-first-slim) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }
  .html-table-col-other-slim {
    width: 100px;
    min-width: 90px;
    max-width: 100px;
  }
  .section-title-container {
    flex-direction: row;
    align-items: center;
  }
  .section-tabs {
    justify-content: flex-end;
    padding-bottom: 0rem;
    overflow-x: auto;
  }
  .tabs-container {
    justify-content: center;
  }
}

@media (min-width: 1280px) {
  .chart-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
  .chart-grid-quad {
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
  }
  .catalogue-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .hero-logo {
    display: block;
  }
  .html-table-wrapper th:first-child:not(.html-table-col-first-slim-header) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }
  .html-table-first-col:not(.html-table-col-first-slim) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }
  .html-table-col-other-slim {
    width: 100px;
    min-width: 90px;
    max-width: 100px;
  }
  .section-title-container {
    flex-direction: row;
    align-items: center;
  }
  .user-analytic-heatmap {
    width: 80%;
  }
}
  .dma-heatmap {
  height: 100%;
  width: 100%;
  margin: auto;
  /* aspect-ratio: 1.5; */
  max-width: 1500px;
  max-height: 1000px;
  /* min-height: 1000px; */
}
