
:root {
  --asper-color-text: #1B1D21;
  --asper-color-text-secondary: #636A79;
  --asper-color-text-label: #636A79;
  --asper-color-text-description: #A8ADB8;
  --asper-color-border: #D9D9D9;
  --asper-color-border-secondary: #F1F2F4;
  --asper-color-fill-alter: #FCFCFD;
  --asper-primary-1: #F6F3FF;
  --asper-primary-5: #7A56FA;
  --asper-neutral-0: #FFFFFF;
  --asper-neutral-8: #1B1D21;
  --asper-red-6: #E50F3E;
  --asper-border-radius: 6px;
  --asper-border-radius-sm: 4px;
  --asper-size-xxs: 4px;
  --asper-size-xs: 8px;
  --asper-size-sm: 12px;
  --asper-size: 16px;
  --asper-size-lg: 24px;
  --asper-control-height: 32px;
  --asper-margin-sm: 12px;
  --asper-padding-sm: 12px;
  --asper-tag-font: "Open Sans", "SM-Regular-Trimmed", Inter, system-ui, sans-serif;
  --asper-font: "Open Sans", Inter, "SM-Regular-Trimmed", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff; color: var(--asper-color-text); font-family: var(--asper-font); }
.asper-echarts-root { display: flex; flex-direction: column; height: 100%; min-height: 360px; padding: 8px 8px 4px; }
/* Content that sizes to itself has to escape the chart floor at every
   level, or the page stays 360px tall and the surplus shows as a gap. */
html:has(.is-table), html:has(.is-scorecard),
body:has(.is-table), body:has(.is-scorecard) { height: auto; }
.asper-echarts-root.is-table, .asper-echarts-root.is-scorecard { height: auto; min-height: 0; }
/* A short table shrinks to its rows; a long one stops once about 10
   data rows are in view and scrolls the rest, rather than growing
   without limit. */
.asper-echarts-root.is-table { max-height: 566px; }
.plot:has(table), .plot:has(.scorecard) { min-height: 0; }
.plot:has(.scorecard) { height: auto; overflow: visible; flex: none; }
.scorecard-entity { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--asper-color-text); }
.scorecard { display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; }
.kpi {
  flex: 1 1 168px; min-width: 152px; display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; background: var(--asper-neutral-0);
  border: 1px solid var(--asper-color-border); border-radius: var(--asper-border-radius);
}
.kpi-label { font-size: 12px; font-weight: 600; color: var(--asper-color-text-label); font-family: var(--asper-tag-font); }
.kpi-value { font-size: 22px; line-height: 30px; font-weight: 600; color: var(--asper-color-text); }
.kpi-support { font-size: 12px; color: var(--asper-color-text-description); }
.kpi-support.up { color: #00CC63; }
.kpi-support.down { color: var(--asper-red-6); }
.asper-chart-title { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--asper-color-text); }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; padding: 8px 0 4px; }
.filters[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 152px; position: relative; }
.label { font-size: 12px; font-weight: 600; line-height: 18px; color: var(--asper-color-text-label); font-family: var(--asper-tag-font); }
.field select {
  appearance: none; -webkit-appearance: none; width: 100%; height: var(--asper-control-height);
  border: 1px solid var(--asper-color-border); border-radius: var(--asper-border-radius-sm);
  background-color: var(--asper-neutral-0);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23636A79' d='M1.2 1.5 6 6.3 10.8 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding: 0 34px 0 12px; font-size: 14px; color: var(--asper-color-text); cursor: pointer; font-family: var(--asper-font);
}
.field select:focus { outline: none; border-color: var(--asper-primary-5); box-shadow: 0 0 0 3px var(--asper-primary-1); }
.field select option:disabled { color: var(--asper-color-text-description); }
.ms-trigger {
  appearance: none; width: 100%; height: var(--asper-control-height);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--asper-color-border); border-radius: var(--asper-border-radius-sm);
  background-color: var(--asper-neutral-0); padding: 0 12px; text-align: left;
  font-size: 14px; font-family: var(--asper-font); color: var(--asper-color-text); cursor: pointer;
}
.ms-trigger:focus-visible { outline: none; border-color: var(--asper-primary-5); box-shadow: 0 0 0 3px var(--asper-primary-1); }
.ms-trigger[aria-expanded="true"] { border-color: var(--asper-primary-5); }
.ms-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-trigger::after {
  content: ""; flex: none; width: 12px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23636A79' d='M1.2 1.5 6 6.3 10.8 1.5'/%3E%3C/svg%3E") no-repeat center;
}
.ms-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 20;
  min-width: 100%; max-width: 320px; padding: 8px;
  background: var(--asper-neutral-0); border: 1px solid var(--asper-color-border);
  border-radius: var(--asper-border-radius); box-shadow: 0 6px 16px rgba(27, 29, 33, 0.12);
}
.ms-panel[hidden] { display: none; }
.ms-search {
  width: 100%; height: 28px; margin-bottom: 6px; padding: 0 8px;
  border: 1px solid var(--asper-color-border); border-radius: var(--asper-border-radius-sm);
  font-size: 13px; font-family: var(--asper-font); color: var(--asper-color-text);
}
.ms-search:focus { outline: none; border-color: var(--asper-primary-5); }
.ms-actions {
  display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 4px 6px; margin-bottom: 6px;
  border-bottom: 1px solid var(--asper-color-border-secondary);
}
/* Two actions can outgrow a narrow filter column; wrapping keeps the
   labels whole instead of shrinking them into ellipses. */
.ms-action {
  background: none; border: none; padding: 0; cursor: pointer; flex: none; white-space: nowrap;
  font-size: 12px; font-family: var(--asper-font); color: var(--asper-primary-5);
}
.ms-action:disabled { color: var(--asper-color-text-description); cursor: default; }
.filter-reset { min-width: auto; }
.reset-actions { display: flex; align-items: center; gap: 8px; height: var(--asper-control-height); }
.reset-btn {
  appearance: none; height: 28px; padding: 0 12px; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--asper-color-border); border-radius: var(--asper-border-radius-sm);
  background: var(--asper-neutral-0); font-size: 13px; font-family: var(--asper-font); color: var(--asper-color-text);
}
.reset-btn:hover:not(:disabled) { border-color: var(--asper-primary-5); color: var(--asper-primary-5); }
.reset-btn:focus-visible { outline: none; border-color: var(--asper-primary-5); box-shadow: 0 0 0 3px var(--asper-primary-1); }
.reset-btn:disabled { color: var(--asper-color-text-description); cursor: default; opacity: 0.6; }
.ms-list { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }
.ms-group {
  padding: 8px 4px 2px; font-size: 11px; font-weight: 600; line-height: 16px;
  color: var(--asper-color-text-label); font-family: var(--asper-tag-font);
}
.ms-option {
  display: flex; align-items: center; gap: 8px; padding: 5px 4px;
  font-size: 13px; border-radius: var(--asper-border-radius-sm); cursor: pointer;
}
.ms-option:hover { background: var(--asper-color-fill-alter); }
.ms-option[hidden] { display: none; }
.ms-option.is-disabled, .ms-option.is-disabled:hover { background: none; cursor: default; opacity: 0.55; }
.ms-option input { width: 14px; height: 14px; accent-color: var(--asper-primary-5); cursor: pointer; }
.ms-option input:disabled { cursor: default; }
.ms-empty { margin: 0; padding: 8px 4px; font-size: 12px; color: var(--asper-color-text-description); }
.plot { width: 100%; flex: 0 1 auto; min-height: 360px; position: relative; overflow: hidden; display: flex; flex-direction: column; overscroll-behavior: contain; }
.plot.is-scroll-x, .plot.is-scroll-y { overflow: hidden; }
.plot-stage { flex: 1 1 auto; min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.plot-body { display: block; width: 100%; height: 100%; }
.plot-scroll { flex: none; height: 8px; overflow-x: auto; overflow-y: hidden; background: #F1F2F4; overscroll-behavior: contain; }
.plot-scroll[hidden] { display: none; }
.plot-scroll-sizer { height: 1px; }
.plot.is-scroll-y { flex-direction: row; }
.plot.is-scroll-y .plot-scroll { width: 8px; height: auto; overflow-y: auto; overflow-x: hidden; }
.plot.is-scroll-y .plot-scroll-sizer { width: 1px; height: auto; }
.plot-scroll::-webkit-scrollbar { height: 8px; width: 8px; }
.plot-scroll::-webkit-scrollbar-thumb { background: #D8DADF; border-radius: 8px; }
.plot-scroll::-webkit-scrollbar-track { background: #F1F2F4; }
.plot.map { min-height: 480px; }
.plot:has(table) { height: auto; min-height: 0; overflow: auto; flex: 1 1 auto; }
.err { color: var(--asper-red-6); padding: 16px; font-size: 14px; }
.empty { display: flex; align-items: center; justify-content: center; min-height: 400px; height: 100%; padding: 16px; text-align: center; font-size: 14px; font-weight: 400; line-height: 22px; color: var(--asper-color-text-description); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--asper-color-border-secondary); text-align: left; padding: 10px 8px; }
table.grid th { font-size: 12px; color: var(--asper-color-text-label); font-weight: 600; font-family: var(--asper-tag-font); }
/* The table scrolls inside a fixed frame, so a header that scrolls out of
   view leaves the reader with columns of unlabelled numbers. */
table.grid thead th { position: sticky; top: 0; z-index: 1; background: var(--asper-neutral-0); }
/* Figures only compare down a column when their digits line up. */
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.grid th.sortable:hover { color: var(--asper-color-text); }
table.grid th.sortable:focus-visible { outline: 2px solid var(--asper-primary-5); outline-offset: -2px; }
.sort-caret { margin-left: 4px; font-size: 9px; color: var(--asper-primary-5); }
table.grid tbody tr:hover { background: var(--asper-primary-1); }
