/* EV+MAP public statistics (/statistic). Loaded only by Views/Statistic/Index.phtml on top of the v7 system. */

.evstat-app {
  --evstat-series: var(--ev-brand, #00a8df);
  --evstat-series-strong: var(--ev-brand-hover, #008fbe);
  --evstat-series-soft: var(--ev-brand-soft, #e8f7fc);
  --evstat-available: var(--ev-success-indicator, #1aa373);
  --evstat-occupied: var(--ev-occupied, #4b87d8);
  --evstat-unavailable: var(--ev-danger, #bd3442);
  --evstat-unknown: #aab7c4;
  --evstat-radius: var(--ev-radius-control, 4px);
  --evstat-card-radius: var(--ev-radius-md, 4px);
  display: grid;
  gap: 18px;
  min-width: 0;
  color: var(--ev-ink, #17212b);
}

.evstat-app.screen.active {
  display: grid;
}

.evstat-app .evstat-activity.is-energy {
  --evstat-series: var(--ev-success-indicator, #1aa373);
  --evstat-series-strong: var(--ev-success-hover, #126f4d);
  --evstat-series-soft: var(--ev-success-soft, #e8f6f0);
}

.evstat-app svg {
  flex: 0 0 auto;
}

/* Page head (same pattern as the station catalog) */
.evstat-app .evstat-head {
  margin-bottom: 0;
}

.evstat-app .evstat-head h1 {
  margin: 0 0 8px;
}

.evstat-app .evstat-meta {
  flex-wrap: wrap;
  gap: 8px 18px;
  font-variant-numeric: tabular-nums;
}

.evstat-app .evstat-meta svg {
  color: var(--ev-muted, #687586);
}

.evstat-app .evstat-freshness[data-statistic-freshness-state="stale"] .live-dot {
  background: #d99a22;
  box-shadow: 0 0 0 4px rgba(217, 154, 34, .18);
}

.evstat-app .evstat-freshness[data-statistic-freshness-state="unknown"] .live-dot {
  background: var(--evstat-unknown);
  box-shadow: 0 0 0 4px rgba(170, 183, 196, .22);
}

.evstat-app .evstat-access {
  align-items: center;
  margin: 0;
}

.evstat-app .evstat-access .evstat-access-action {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .evstat-app .evstat-access .evstat-access-action {
    grid-column: 2;
    justify-self: start;
  }
}

/* Filters: catalog choice chips driving hidden native controls */
.evstat-app .evstat-filters {
  display: grid;
  gap: 8px;
  margin: 0;
  overflow: visible;
}

.evstat-app .evstat-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.evstat-app .evstat-choice-grid {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.evstat-app .evstat-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.evstat-app .evstat-filter-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  white-space: nowrap;
}

.evstat-app .evstat-filter-actions .button.is-done {
  border-color: var(--ev-success-indicator, #1aa373);
  background: var(--ev-success-soft, #e8f6f0);
  color: var(--ev-success-text, #126a4a);
}

.evstat-app .evstat-filter-status {
  margin: 0;
  color: var(--ev-muted, #687586);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.evstat-app .evstat-filter-status:empty {
  display: none;
}

.evstat-app .evstat-filter-status.is-error {
  color: var(--ev-danger-text, #9b2e37);
  font-weight: var(--ev-weight-semibold, 650);
}

.evstat-app .directory-choice-field {
  display: block;
  min-width: 0;
}

.evstat-app .directory-choice-control {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
  background: var(--ev-surface, #fff);
  overflow: hidden;
}

.evstat-app .directory-choice-control:is(:hover, :focus-within) {
  border-color: var(--ev-info, #006f95);
}

.evstat-app .directory-choice-control.is-selected {
  border-color: color-mix(in srgb, var(--ev-info, #006f95) 45%, var(--ev-line, #e1e6ec));
  background: var(--ev-brand-soft, #e8f7fc);
}

.evstat-app .directory-choice-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ev-ink, #17212b);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.evstat-app .directory-choice-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.evstat-app .directory-choice-copy strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.evstat-app .has-value .directory-choice-copy > span {
  color: var(--ev-muted, #687586);
  font-size: 10px;
  font-weight: 500;
}

.evstat-app .directory-choice-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.evstat-app .directory-choice-chevron {
  margin-left: auto;
  color: var(--ev-muted, #687586);
}

.evstat-app .directory-choice-reset {
  align-self: center;
  min-width: 32px;
  min-height: 36px;
  margin-right: 3px;
  padding: 4px;
  border: 0;
  border-radius: var(--evstat-radius);
  background: transparent;
  color: var(--ev-info, #006f95);
  font-size: 20px;
  cursor: pointer;
}

.evstat-app .directory-choice-dialog:not([open]) {
  display: none;
}

.evstat-app .directory-choice-dialog {
  position: fixed;
  inset: auto;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
  background: var(--ev-surface, #fff);
  color: var(--ev-ink, #17212b);
  box-shadow: 0 20px 64px #10284230;
  overflow: hidden;
}

.evstat-app .directory-choice-dialog::backdrop {
  background: #10284230;
}

.evstat-app .directory-choice-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ev-line, #e1e6ec);
}

.evstat-app .directory-choice-heading h2 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.evstat-app .directory-choice-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--evstat-radius);
  background: var(--ev-canvas, #f5f7f9);
  color: var(--ev-ink, #17212b);
  font-size: 24px;
  cursor: pointer;
}

.evstat-app .directory-choice-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

.evstat-app .directory-choice-dialog:not([data-choice-key="period"]) .directory-choice-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.evstat-app .directory-operator-search {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
  overflow: hidden;
}

.evstat-app [data-statistic-choice-search] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 10px 12px;
  border: 0;
  background: var(--ev-surface, #fff);
  color: var(--ev-ink, #17212b);
  font-size: 16px;
}

.evstat-app [data-statistic-choice-search]::-webkit-search-cancel-button {
  display: none;
}

.evstat-app [data-statistic-choice-search-clear] {
  flex: 0 0 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ev-muted, #687586);
  font-size: 22px;
  cursor: pointer;
}

.evstat-app .directory-operator-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ev-muted, #687586);
  font-size: 12px;
}

.evstat-app .directory-operator-toolbar [role="group"] {
  display: flex;
  gap: 4px;
}

.evstat-app [data-statistic-choice-sort] {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
  background: var(--ev-surface, #fff);
  color: var(--ev-ink-2, #354252);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.evstat-app .evstat-choice-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.evstat-app :is(.directory-operator-option, .directory-operator-all, .directory-choice-options button, .evstat-choice-locked) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--evstat-radius);
  background: var(--ev-surface, #fff);
  color: var(--ev-ink, #17212b);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.evstat-app .directory-operator-all {
  flex-shrink: 0;
  border-color: var(--ev-line, #e1e6ec);
}

.evstat-app :is(.directory-operator-option, .evstat-choice-locked) > span {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.evstat-app :is(.directory-operator-option, .evstat-choice-locked) small {
  color: var(--ev-muted, #687586);
  font-size: 11px;
  line-height: 1.4;
}

.evstat-app :is(.directory-operator-option, .directory-choice-options button) b {
  margin-left: auto;
  color: var(--ev-muted, #687586);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.evstat-app :is(.directory-operator-option, .directory-choice-options button) i {
  min-width: 16px;
  color: var(--ev-info, #006f95);
  font-style: normal;
}

.evstat-app .directory-choice-dialog button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--ev-info, #006f95) 45%, var(--ev-line, #e1e6ec));
  background: var(--ev-brand-soft, #e8f7fc);
  color: var(--ev-info, #006f95);
}

.evstat-app .directory-choice-dialog :is(button, .evstat-choice-locked):hover {
  background: var(--ev-brand-soft, #e8f7fc);
}

.evstat-app :is(.directory-choice-dialog button, .directory-choice-toggle, .directory-choice-reset, [data-statistic-choice-search], .evstat-choice-locked):focus-visible {
  outline: 2px solid var(--ev-info, #006f95);
  outline-offset: -3px;
}

.evstat-app .directory-choice-dialog mark {
  background: color-mix(in srgb, var(--ev-info, #006f95) 14%, transparent);
  color: inherit;
  font-weight: 750;
}

.evstat-app .directory-choice-options {
  display: grid;
  gap: 6px;
}

.evstat-app .directory-choice-options span {
  flex: 1;
}

.evstat-app :is(.directory-choice-note, .directory-choice-empty) {
  margin: 14px 0;
  color: var(--ev-muted, #687586);
  font-size: 12px;
  line-height: 1.55;
}

.evstat-app .evstat-choice-group {
  margin: 12px 2px 6px;
  color: var(--ev-muted, #687586);
  font-size: 10.5px;
  font-weight: var(--ev-weight-extra, 800);
  letter-spacing: var(--ev-tracking-label, .3px);
  text-transform: uppercase;
}

.evstat-app .evstat-choice-list > .evstat-choice-group:first-child {
  margin-top: 2px;
}

.evstat-app .evstat-choice-locked {
  margin-top: 6px;
  border-color: var(--ev-warning-border, #e3bc72);
  background: var(--ev-warning-soft, #fff5df);
  color: var(--ev-warning-text, #79520a);
  text-decoration: none;
}

.evstat-app .evstat-choice-locked svg {
  width: 18px;
  height: 18px;
}

.evstat-app .evstat-choice-range {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 4px;
  border-top: 1px solid var(--ev-line, #e1e6ec);
}

.evstat-app .evstat-choice-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.evstat-app .evstat-choice-dates .date-control {
  height: 44px;
  border-radius: var(--evstat-radius);
  font-variant-numeric: tabular-nums;
}

.evstat-app .evstat-choice-dates .date-control[aria-invalid="true"] {
  border-color: var(--ev-danger, #bd3442);
  box-shadow: 0 0 0 3px rgba(189, 52, 66, .14);
}

.evstat-app .evstat-choice-error {
  margin: 0;
  color: var(--ev-danger-text, #9b2e37);
  font-size: 12px;
  font-weight: var(--ev-weight-semibold, 650);
}

.evstat-app .evstat-choice-range .button {
  min-height: 44px;
}

/* Tabs */
.evstat-tabs-bar {
  position: sticky;
  top: var(--ev-header-h, 64px);
  z-index: 30;
  display: grid;
  gap: 0;
  margin-top: -8px;
  padding-top: 8px;
  background: var(--ev-canvas, #f5f7f9);
  scroll-margin-top: var(--ev-header-h, 64px);
}

.evstat-tabs {
  display: flex;
  gap: 3px;
  width: max-content;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
  background: rgba(233, 238, 242, .92);
  box-shadow: 0 6px 18px rgba(20, 28, 36, .06);
  backdrop-filter: blur(6px);
  scrollbar-width: none;
}

.evstat-tabs::-webkit-scrollbar {
  display: none;
}

.evstat-tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--evstat-radius);
  background: transparent;
  color: var(--ev-ink-2, #354252);
  font-size: 13.5px;
  font-weight: var(--ev-weight-semibold, 650);
  white-space: nowrap;
  cursor: pointer;
}

.evstat-tabs [role="tab"] svg {
  width: 17px;
  height: 17px;
  color: var(--ev-muted, #687586);
}

.evstat-tabs [role="tab"]:hover {
  background: rgba(255, 255, 255, .66);
  color: var(--ev-ink, #17212b);
}

.evstat-tabs [role="tab"].is-active {
  background: var(--ev-surface, #fff);
  color: var(--ev-ink, #17212b);
  font-weight: var(--ev-weight-extra, 800);
  box-shadow: 0 1px 4px var(--ev-shadow-color-09, rgba(20, 28, 36, .09));
}

.evstat-tabs [role="tab"].is-active svg {
  color: var(--ev-brand, #00a8df);
}

.evstat-progress {
  position: relative;
  height: 3px;
  margin: 6px 6px 0;
  overflow: hidden;
  border-radius: 3px;
  opacity: 0;
  transition: opacity var(--ev-duration-normal, 220ms) ease;
}

.evstat-progress.is-active {
  opacity: 1;
}

.evstat-progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--ev-brand, #00a8df), transparent);
  animation: evstat-progress 1.2s var(--ev-ease-standard, ease) infinite;
}

@keyframes evstat-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(270%); }
}

.evstat-app.is-busy .evstat-views {
  opacity: .72;
  transition: opacity var(--ev-duration-normal, 220ms) ease;
}

.evstat-alert {
  margin: 0;
}

.evstat-alert .button {
  align-self: center;
}

.evstat-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 34px 20px;
  border: 1px dashed var(--ev-line-strong, #cbd4df);
  border-radius: var(--evstat-card-radius);
  background: var(--ev-surface, #fff);
  text-align: center;
}

.evstat-empty svg {
  width: 34px;
  height: 34px;
  color: var(--ev-muted-2, #8995a4);
}

.evstat-empty span {
  color: var(--ev-muted, #687586);
  font-size: 13px;
}

.evstat-views,
.evstat-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.evstat-panel[hidden] {
  display: none;
}

.evstat-panel:focus-visible {
  border-radius: var(--evstat-card-radius);
}

/* Cards and section headings */
.evstat-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-card-radius);
  background: var(--ev-surface, #fff);
  box-shadow: var(--ev-shadow-card, 0 6px 22px rgba(20, 28, 36, .05));
}

.evstat-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}

.evstat-card-head h3,
.evstat-ranking-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: var(--ev-weight-extra, 800);
  line-height: 1.3;
}

.evstat-ranking-head h2 {
  font-size: 18px;
}

.evstat-card-head p,
.evstat-ranking-head p,
.evstat-section-head p {
  margin: 3px 0 0;
  color: var(--ev-muted, #687586);
  font-size: 12.5px;
  line-height: 1.45;
}

.evstat-section-title {
  margin: 0;
  font-size: 17px;
  font-weight: var(--ev-weight-extra, 800);
  letter-spacing: var(--ev-tracking-tight, -.2px);
}

.evstat-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
}

.evstat-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.evstat-segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--evstat-radius);
  background: var(--ev-tab-track, #e9eef2);
}

.evstat-segmented [role="radio"] {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--evstat-radius);
  background: transparent;
  color: var(--ev-ink-2, #354252);
  font-size: 12.5px;
  font-weight: var(--ev-weight-semibold, 650);
  white-space: nowrap;
  cursor: pointer;
}

.evstat-segmented [role="radio"].is-active {
  background: var(--ev-surface, #fff);
  color: var(--ev-ink, #17212b);
  font-weight: var(--ev-weight-extra, 800);
  box-shadow: 0 1px 4px var(--ev-shadow-color-09, rgba(20, 28, 36, .09));
}

.evstat-inline-empty {
  margin: 0;
  padding: 26px 12px;
  color: var(--ev-muted, #687586);
  font-size: 13px;
  text-align: center;
}

/* KPI */
.evstat-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.evstat-kpi {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px 14px;
  overflow: hidden;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-card-radius);
  background: var(--ev-surface, #fff);
  box-shadow: var(--ev-shadow-card, 0 6px 22px rgba(20, 28, 36, .05));
  --evstat-kpi-accent: var(--ev-brand, #00a8df);
  --evstat-kpi-soft: var(--ev-brand-soft, #e8f7fc);
}

.evstat-kpi.is-energy {
  --evstat-kpi-accent: var(--ev-success-indicator, #1aa373);
  --evstat-kpi-soft: var(--ev-success-soft, #e8f6f0);
}

.evstat-kpi.is-locations {
  --evstat-kpi-accent: #7a5af8;
  --evstat-kpi-soft: #f1edff;
}

.evstat-kpi.is-status {
  --evstat-kpi-accent: var(--ev-occupied, #4b87d8);
  --evstat-kpi-soft: var(--ev-occupied-soft, #edf5ff);
}

.evstat-kpi-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.evstat-kpi-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--evstat-radius);
  background: var(--evstat-kpi-soft);
  color: var(--evstat-kpi-accent);
}

.evstat-kpi-icon svg {
  width: 17px;
  height: 17px;
}

.evstat-kpi-label {
  color: var(--ev-ink-2, #354252);
  font-size: 12.5px;
  font-weight: var(--ev-weight-bold, 700);
  line-height: 1.3;
}

.evstat-kpi-value {
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: var(--ev-weight-extra, 800);
  line-height: 1.1;
  letter-spacing: var(--ev-tracking-title, -.45px);
  font-variant-numeric: tabular-nums;
}

.evstat-kpi-value .skeleton {
  display: inline-block;
  min-width: 7ch;
}

.evstat-kpi-detail {
  display: grid;
  gap: 7px;
  color: var(--ev-muted, #687586);
  font-size: 12px;
  line-height: 1.4;
}

.evstat-kpi-visual {
  display: grid;
  gap: 8px;
  align-self: end;
  min-height: 0;
}

.evstat-kpi-visual:empty {
  display: none;
}

.evstat-spark {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 4px;
}

.evstat-spark-area {
  fill: var(--evstat-kpi-soft);
}

.evstat-spark-line {
  fill: none;
  stroke: var(--evstat-kpi-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.evstat-meter {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--ev-neutral-100, #edf1f4);
}

.evstat-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ev-success-indicator, #1aa373);
}

.evstat-meter.is-low > span {
  background: #d99a22;
}

.evstat-status-bar {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--ev-neutral-100, #edf1f4);
}

.evstat-status-bar > span {
  display: block;
  height: 100%;
  min-width: 2px;
}

.evstat-status-bar > span + span {
  box-shadow: -1px 0 0 var(--ev-surface, #fff);
}

.evstat-status-bar .is-available,
.evstat-status-legend .is-available {
  background: var(--evstat-available);
}

.evstat-status-bar .is-occupied,
.evstat-status-legend .is-occupied {
  background: var(--evstat-occupied);
}

.evstat-status-bar .is-unavailable,
.evstat-status-legend .is-unavailable {
  background: var(--evstat-unavailable);
}

.evstat-status-bar .is-unknown,
.evstat-status-legend .is-unknown {
  background: var(--evstat-unknown);
}

.evstat-status-bar.is-compact {
  width: 100%;
  max-width: 132px;
  height: 6px;
  margin-left: auto;
}

.evstat-status-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  color: var(--ev-muted, #687586);
  font-size: 11.5px;
  list-style: none;
}

.evstat-status-legend li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  line-height: 1.3;
}

.evstat-status-legend i {
  transform: translateY(1px);
}

.evstat-status-legend i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.evstat-status-legend b {
  margin-left: auto;
  color: var(--ev-ink-2, #354252);
  font-variant-numeric: tabular-nums;
}

.evstat-kpi-note {
  color: var(--ev-muted-2, #8995a4);
  font-size: 11px;
}

/* Insights */
.evstat-insights {
  display: grid;
  gap: 10px;
}

.evstat-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.evstat-insight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-card-radius);
  background: linear-gradient(180deg, var(--ev-surface, #fff), var(--ev-surface-2, #f8fafc));
}

.evstat-insight-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--evstat-radius);
  background: var(--ev-brand-soft, #e8f7fc);
  color: var(--ev-info, #006f95);
}

.evstat-insight-icon svg {
  width: 18px;
  height: 18px;
}

.evstat-insight > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.evstat-insight-label {
  color: var(--ev-muted, #687586);
  font-size: 10.5px;
  font-weight: var(--ev-weight-extra, 800);
  letter-spacing: var(--ev-tracking-label, .3px);
  text-transform: uppercase;
}

.evstat-insight strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: var(--ev-weight-extra, 800);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.evstat-insight-detail {
  color: var(--ev-body-copy, #52606d);
  font-size: 12px;
  line-height: 1.4;
}

/* Charts */
.evstat-activity {
  display: grid;
  gap: 14px;
}

.evstat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  color: var(--ev-muted, #687586);
  font-size: 11.5px;
  list-style: none;
}

.evstat-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.evstat-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.evstat-swatch.is-series {
  background: var(--evstat-series);
}

.evstat-swatch.is-weekend {
  background: #eef3f7;
  box-shadow: inset 0 0 0 1px var(--ev-line, #e1e6ec);
}

.evstat-swatch.is-partial {
  background: repeating-linear-gradient(45deg, var(--evstat-series-soft) 0 3px, var(--evstat-series) 3px 4.5px);
}

.evstat-swatch.is-average {
  height: 0;
  border-top: 2px dashed var(--ev-ink-2, #354252);
  border-radius: 0;
  opacity: .55;
}

.evstat-trend-card.is-single .evstat-legend {
  display: none;
}

.evstat-chart {
  position: relative;
  min-width: 0;
  min-height: 120px;
  border-radius: var(--evstat-radius);
}

.evstat-chart:focus-visible {
  outline: none;
  box-shadow: var(--ev-focus, 0 0 0 3px rgba(0, 168, 223, .22));
}

.evstat-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}

.evstat-svg text {
  font-family: var(--ev-font-sans, Inter, sans-serif);
}

.evstat-grid {
  stroke: #edf1f4;
  stroke-width: 1;
}

.evstat-axis {
  stroke: var(--ev-line-strong, #cbd4df);
  stroke-width: 1;
}

.evstat-tick {
  fill: var(--ev-muted, #687586);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.evstat-unit {
  font-weight: var(--ev-weight-bold, 700);
}

.evstat-band {
  fill: #f3f6f9;
}

.evstat-bar {
  fill: var(--evstat-series);
  transition: fill var(--ev-duration-fast, 140ms) ease, opacity var(--ev-duration-fast, 140ms) ease;
}

.evstat-bar.is-partial {
  opacity: .9;
}

.evstat-hatch-bg {
  fill: var(--evstat-series-soft);
}

.evstat-hatch-line {
  stroke: var(--evstat-series);
  stroke-width: 3;
}

.evstat-bar.is-peak {
  fill: var(--evstat-series-strong);
}

.evstat-bar.is-active {
  fill: var(--evstat-series-strong);
  opacity: 1;
}

.evstat-average {
  stroke: var(--ev-ink-2, #354252);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  opacity: .5;
}

.evstat-hit {
  fill: transparent;
}

.evstat-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 170px;
  max-width: 250px;
  padding: 10px 12px;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--ev-shadow-md, 0 18px 48px rgba(20, 28, 36, .16));
  pointer-events: none;
}

.evstat-tooltip strong {
  display: block;
  font-size: 12.5px;
  font-weight: var(--ev-weight-extra, 800);
}

.evstat-tooltip em {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 7px;
  border-radius: 2px;
  background: var(--ev-warning-soft, #fff5df);
  color: var(--ev-warning-text, #79520a);
  font-size: 10.5px;
  font-style: normal;
  font-weight: var(--ev-weight-bold, 700);
}

.evstat-tooltip dl {
  display: grid;
  gap: 3px;
  margin: 7px 0 0;
}

.evstat-tooltip dl > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
}

.evstat-tooltip dt {
  color: var(--ev-muted, #687586);
}

.evstat-tooltip dd {
  margin: 0;
  font-weight: var(--ev-weight-bold, 700);
  font-variant-numeric: tabular-nums;
}

.evstat-single-day {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 18px 28px;
  align-items: center;
  padding: 22px;
  border: 1px dashed var(--ev-line-strong, #cbd4df);
  border-radius: var(--evstat-radius);
  background: var(--ev-surface-2, #f8fafc);
}

.evstat-single-day-values {
  display: grid;
  gap: 3px;
}

.evstat-single-day-values span {
  color: var(--ev-muted, #687586);
  font-size: 12.5px;
}

.evstat-single-day-values strong {
  font-size: 24px;
  font-weight: var(--ev-weight-extra, 800);
  font-variant-numeric: tabular-nums;
}

.evstat-single-day-copy {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.evstat-single-day-copy p {
  margin: 0;
  color: var(--ev-body-copy, #52606d);
  font-size: 13px;
  line-height: 1.5;
}

/* Heatmap */
.evstat-heat-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ev-muted, #687586);
  font-size: 11px;
}

.evstat-heat-scale {
  display: inline-flex;
  gap: 2px;
}

.evstat-heat-scale i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.evstat-heatmap-scroll {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.evstat-heatmap {
  display: grid;
  gap: 3px;
  min-width: 470px;
  border-radius: var(--evstat-radius);
}

.evstat-heatmap:focus-visible {
  outline: none;
  box-shadow: var(--ev-focus, 0 0 0 3px rgba(0, 168, 223, .22));
}

.evstat-heat-row {
  display: grid;
  grid-template-columns: 38px repeat(24, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
}

.evstat-heat-hours span {
  color: var(--ev-muted, #687586);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.evstat-heat-day {
  color: var(--ev-ink-2, #354252);
  font-size: 11px;
  font-weight: var(--ev-weight-semibold, 650);
  text-transform: capitalize;
}

.evstat-heat-cell,
.evstat-heat-scale i {
  display: block;
  background: var(--ev-neutral-100, #edf1f4);
}

.evstat-heat-cell {
  aspect-ratio: 1 / 1;
  min-height: 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: transform var(--ev-duration-fast, 140ms) ease;
}

.evstat-heat-cell.level-1,
.evstat-heat-scale .level-1 { background: color-mix(in srgb, var(--evstat-series) 16%, #f3f7fa); }
.evstat-heat-cell.level-2,
.evstat-heat-scale .level-2 { background: color-mix(in srgb, var(--evstat-series) 32%, #f3f7fa); }
.evstat-heat-cell.level-3,
.evstat-heat-scale .level-3 { background: color-mix(in srgb, var(--evstat-series) 50%, #f3f7fa); }
.evstat-heat-cell.level-4,
.evstat-heat-scale .level-4 { background: color-mix(in srgb, var(--evstat-series) 68%, #f3f7fa); }
.evstat-heat-cell.level-5,
.evstat-heat-scale .level-5 { background: var(--evstat-series); }
.evstat-heat-cell.level-6,
.evstat-heat-scale .level-6 { background: var(--evstat-series-strong); }

.evstat-heat-cell.is-active {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px var(--ev-surface, #fff), 0 0 0 4px var(--ev-ink, #17212b);
}

.evstat-heat-detail {
  min-height: 18px;
  margin: 0;
  color: var(--ev-ink-2, #354252);
  font-size: 12.5px;
  font-weight: var(--ev-weight-semibold, 650);
  font-variant-numeric: tabular-nums;
}

/* Top lists */
.evstat-toplist-host {
  display: grid;
  gap: 12px;
}

.evstat-toplist {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evstat-toplist li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--ev-line-subtle, #edf1ef);
}

.evstat-toplist li:first-child {
  border-top: 0;
  padding-top: 2px;
}

.evstat-rank {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: var(--evstat-radius);
  background: var(--ev-neutral-100, #edf1f4);
  color: var(--ev-ink-2, #354252);
  font-size: 12px;
  font-weight: var(--ev-weight-extra, 800);
  font-variant-numeric: tabular-nums;
}

.evstat-rank.is-first {
  background: #fff4d6;
  color: #8a5a00;
}

.evstat-toplist-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.evstat-toplist-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.evstat-toplist-line > strong {
  font-size: 15px;
  font-weight: var(--ev-weight-extra, 800);
  font-variant-numeric: tabular-nums;
}

.evstat-toplist-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  color: var(--ev-muted, #687586);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.evstat-share {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--ev-neutral-100, #edf1f4);
}

.evstat-share > span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ev-brand, #00a8df), #33c1ea);
}

.evstat-share.is-inline {
  width: 100%;
  max-width: 132px;
  height: 4px;
  margin: 5px 0 4px auto;
}

.evstat-entity {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ev-ink, #17212b);
  font: inherit;
  text-align: left;
}

.evstat-entity.is-link {
  cursor: pointer;
}

.evstat-entity-name {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: var(--ev-weight-bold, 700);
  line-height: 1.3;
}

.evstat-entity.is-link .evstat-entity-name {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--ev-duration-fast, 140ms) ease, text-decoration-color var(--ev-duration-fast, 140ms) ease;
}

.evstat-entity.is-link:hover .evstat-entity-name,
.evstat-entity.is-link:focus-visible .evstat-entity-name {
  color: var(--ev-info, #006f95);
  text-decoration-color: currentColor;
}

.evstat-entity-sub {
  color: var(--ev-muted, #687586);
  font-size: 11.5px;
  font-weight: var(--ev-weight-regular, 400);
}

.evstat-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-height: 34px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--ev-info, #006f95);
  font-size: 13px;
  font-weight: var(--ev-weight-bold, 700);
  cursor: pointer;
}

.evstat-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--ev-duration-fast, 140ms) ease;
}

.evstat-link:hover svg {
  transform: translateX(3px);
}

/* Ranking tables */
.evstat-ranking {
  gap: 12px;
}

.evstat-ranking-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 18px;
}

.evstat-ranking-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.evstat-sort-field {
  width: 210px;
}

.evstat-result-count {
  margin: 0;
  color: var(--ev-muted, #687586);
  font-size: 12.5px;
  font-weight: var(--ev-weight-semibold, 650);
}

.evstat-table-region {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
}

.evstat-table-region:empty {
  display: none;
}

.evstat-table-region:focus-visible {
  outline: none;
  box-shadow: var(--ev-focus, 0 0 0 3px rgba(0, 168, 223, .22));
}

.evstat-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.evstat-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ev-line, #e1e6ec);
  background: var(--ev-surface-2, #f8fafc);
  color: var(--ev-muted, #687586);
  font-size: 11px;
  font-weight: var(--ev-weight-extra, 800);
  letter-spacing: var(--ev-tracking-label, .3px);
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.evstat-table thead th:nth-child(2) {
  text-align: left;
}

.evstat-table tbody tr {
  transition: background var(--ev-duration-fast, 140ms) ease;
}

.evstat-table tbody tr:hover {
  background: #fbfcfd;
}

.evstat-table tbody th,
.evstat-table tbody td {
  padding: 12px;
  border-top: 1px solid var(--ev-line-subtle, #edf1ef);
  vertical-align: top;
}

.evstat-table tbody tr:first-child th,
.evstat-table tbody tr:first-child td {
  border-top: 0;
}

.evstat-table tbody th {
  min-width: 190px;
  font-weight: inherit;
  text-align: left;
}

.evstat-table .evstat-col-rank {
  width: 52px;
  text-align: left;
}

.evstat-num {
  text-align: right;
}

.evstat-cell-value {
  display: block;
  font-size: 14px;
  font-weight: var(--ev-weight-bold, 700);
  white-space: nowrap;
}

.evstat-cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--ev-muted, #687586);
  font-size: 11.5px;
  white-space: nowrap;
}

.evstat-energy {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.evstat-coverage,
.evstat-tone {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: var(--ev-weight-bold, 700);
  white-space: nowrap;
}

.evstat-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.evstat-sort:hover,
.evstat-sort.is-active {
  color: var(--ev-ink, #17212b);
}

.evstat-sort-icon {
  position: relative;
  width: 8px;
  height: 11px;
  opacity: .45;
}

.evstat-sort-icon::before,
.evstat-sort-icon::after {
  content: "";
  position: absolute;
  left: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.evstat-sort-icon::before {
  top: 0;
  border-bottom: 4px solid currentColor;
}

.evstat-sort-icon::after {
  bottom: 0;
  border-top: 4px solid currentColor;
}

.evstat-sort.is-active .evstat-sort-icon {
  opacity: 1;
  color: var(--ev-brand, #00a8df);
}

.evstat-sort.is-active.is-desc .evstat-sort-icon::before,
.evstat-sort.is-active.is-asc .evstat-sort-icon::after {
  opacity: .25;
}

.evstat-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--ev-ink-2, #354252);
  font-size: 12.5px;
  font-weight: var(--ev-weight-semibold, 650);
  font-variant-numeric: tabular-nums;
}

.evstat-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 16px 18px;
  border: 1px solid var(--ev-brand-border, #b6dfee);
  border-radius: var(--evstat-card-radius);
  background: linear-gradient(90deg, var(--ev-brand-soft, #e8f7fc), var(--ev-surface, #fff));
  color: var(--ev-ink-2, #354252);
  font-size: 13.5px;
  font-weight: var(--ev-weight-semibold, 650);
}

.evstat-cta > span:nth-child(2) {
  flex: 1 1 260px;
}

.evstat-cta-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--evstat-radius);
  background: var(--ev-surface, #fff);
  color: var(--ev-info, #006f95);
}

.evstat-cta-icon svg {
  width: 19px;
  height: 19px;
}

/* Methodology */
.evstat-method-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.evstat-method-main,
.evstat-method {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.evstat-method-intro h2 {
  margin: 0;
  font-size: 20px;
  font-weight: var(--ev-weight-extra, 800);
}

.evstat-method-intro p {
  margin: 4px 0 0;
  color: var(--ev-muted, #687586);
  font-size: 13px;
}

.evstat-method-rail {
  position: sticky;
  top: calc(var(--ev-header-h, 64px) + 80px);
}

.evstat-quality h3 {
  margin: 0;
  font-size: 15px;
  font-weight: var(--ev-weight-extra, 800);
}

.evstat-quality-coverage {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--evstat-radius);
  background: var(--ev-success-soft, #e8f6f0);
}

.evstat-quality-coverage.is-low {
  background: var(--ev-warning-soft, #fff5df);
}

.evstat-quality-coverage strong {
  font-size: 26px;
  font-weight: var(--ev-weight-extra, 800);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.evstat-quality-coverage span:not(.evstat-meter) {
  color: var(--ev-ink-2, #354252);
  font-size: 12px;
  font-weight: var(--ev-weight-semibold, 650);
}

.evstat-quality-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.evstat-quality-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--ev-line-subtle, #edf1ef);
  font-size: 12.5px;
}

.evstat-quality-list dt {
  color: var(--ev-muted, #687586);
}

.evstat-quality-list dd {
  margin: 0;
  font-weight: var(--ev-weight-bold, 700);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.evstat-method-lead,
.evstat-method-card,
.evstat-formula-card {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-card-radius);
  background: var(--ev-surface, #fff);
}

.evstat-method-lead {
  border-color: var(--ev-brand-border, #b6dfee);
  background: linear-gradient(135deg, var(--ev-brand-soft, #e8f7fc), var(--ev-surface, #fff) 70%);
}

.evstat-method-lead.is-low,
.evstat-interpretation.is-low {
  border-color: var(--ev-warning-border, #e3bc72);
  background: var(--ev-warning-soft, #fff5df);
}

.evstat-method h3 {
  margin: 0;
  font-size: 16px;
  font-weight: var(--ev-weight-extra, 800);
  line-height: 1.35;
}

.evstat-method p,
.evstat-method li {
  margin: 0;
  color: var(--ev-body-copy, #52606d);
  font-size: 13px;
  line-height: 1.55;
}

.evstat-method-eyebrow {
  color: var(--ev-info, #006f95);
  font-size: 10.5px;
  font-weight: var(--ev-weight-extra, 800);
  letter-spacing: var(--ev-tracking-meta, .6px);
  text-transform: uppercase;
}

.evstat-method-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evstat-method-metrics span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--evstat-radius);
  background: rgba(255, 255, 255, .78);
}

.evstat-method-metrics strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.evstat-method-metrics small {
  color: var(--ev-muted, #687586);
  font-size: 11.5px;
}

.evstat-method-flow,
.evstat-source-priority ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evstat-method-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.evstat-method-flow li,
.evstat-source-priority li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.evstat-method-flow li {
  align-content: start;
  padding: 14px;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-card-radius);
  background: var(--ev-surface, #fff);
}

.evstat-method-flow li > span,
.evstat-source-priority li > span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--evstat-radius);
  background: var(--ev-brand-soft, #e8f7fc);
  color: var(--ev-info, #006f95);
  font-size: 12px;
  font-weight: var(--ev-weight-extra, 800);
}

.evstat-method-flow strong,
.evstat-source-priority strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ev-ink, #17212b);
  font-size: 13px;
}

.evstat-formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.evstat-method code {
  padding: 1px 5px;
  border-radius: var(--evstat-radius);
  background: var(--ev-neutral-100, #edf1f4);
  color: var(--ev-ink, #17212b);
  font-family: var(--ev-font-mono, monospace);
  font-size: 12px;
}

.evstat-formula-card > code,
.evstat-report-formulas code {
  display: block;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: var(--evstat-radius);
  background: #141c24;
  color: #e8f7fc;
  white-space: nowrap;
}

.evstat-report-formulas > div {
  display: grid;
  gap: 6px;
}

.evstat-model-details summary {
  color: var(--ev-ink, #17212b);
  font-size: 14px;
  font-weight: var(--ev-weight-extra, 800);
  cursor: pointer;
}

.evstat-model-details-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.evstat-model-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-radius);
}

.evstat-model-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.evstat-model-table th,
.evstat-model-table td {
  padding: 9px 12px;
  border-top: 1px solid var(--ev-line-subtle, #edf1ef);
  text-align: left;
  vertical-align: top;
}

.evstat-model-table thead th {
  border-top: 0;
  background: var(--ev-surface-2, #f8fafc);
  color: var(--ev-muted, #687586);
  font-size: 11px;
  text-transform: uppercase;
}

.evstat-model-table tbody th {
  white-space: nowrap;
}

.evstat-model-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.evstat-model-notes h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.evstat-model-footnote {
  color: var(--ev-muted, #687586) !important;
  font-size: 12px !important;
}

.evstat-interpretation ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.evstat-definitions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.evstat-definitions section {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--ev-line, #e1e6ec);
  border-radius: var(--evstat-card-radius);
  background: var(--ev-surface, #fff);
}

.evstat-definitions h3 {
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1180px) {
  .evstat-method-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .evstat-method-rail {
    position: static;
  }

  .evstat-method-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) {
  .evstat-kpis,
  .evstat-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evstat-grid-2:not(.evstat-top-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .evstat-app .evstat-filter-actions {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .evstat-app {
    gap: 14px;
  }

  .evstat-top-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .evstat-card {
    padding: 16px;
  }

  .evstat-app .evstat-choice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .evstat-app .directory-choice-toggle {
    flex: 1;
    min-width: 0;
    min-height: 52px;
  }

  .evstat-app .directory-choice-reset {
    min-width: 40px;
    min-height: 44px;
  }

  .evstat-app .evstat-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .evstat-app .evstat-filter-actions .button {
    justify-content: center;
  }

  .evstat-app .directory-choice-dialog {
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) !important;
    width: calc(100% - 24px);
    max-height: calc(100dvh - 48px) !important;
  }

  .evstat-app .directory-choice-heading {
    padding: 10px 12px;
  }

  .evstat-app .directory-choice-body {
    padding: 12px;
  }

  .evstat-app [data-statistic-choice-sort] {
    min-height: 44px;
  }

  .evstat-tabs-bar {
    margin: -8px -14px 0;
    padding: 8px 14px 0;
  }

  .evstat-tabs {
    width: 100%;
  }

  .evstat-tabs [role="tab"] {
    flex: 1 0 auto;
    justify-content: center;
    padding: 0 12px;
  }

  .evstat-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .evstat-kpi {
    padding: 13px 14px 12px;
  }

  .evstat-kpi.is-locations,
  .evstat-kpi.is-status {
    grid-column: 1 / -1;
  }

  .evstat-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .evstat-insight {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .evstat-insight-icon {
    display: none;
  }

  .evstat-insight strong {
    font-size: 15px;
    white-space: normal;
  }

  .evstat-heatmap {
    min-width: 0;
    gap: 2px;
  }

  .evstat-heat-row {
    grid-template-columns: 30px repeat(24, minmax(0, 1fr));
    gap: 2px;
  }

  .evstat-heat-cell {
    min-height: 0;
    border-radius: 2px;
  }

  .evstat-heat-hours span {
    font-size: 9px;
  }

  .evstat-kpi-value {
    font-size: 22px;
  }

  .evstat-section-head {
    align-items: flex-start;
  }

  .evstat-single-day {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .evstat-ranking-head,
  .evstat-ranking-controls {
    align-items: stretch;
  }

  .evstat-ranking-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .evstat-ranking-controls .evstat-segmented {
    grid-column: 1 / -1;
  }

  .evstat-ranking-controls .evstat-segmented [role="radio"] {
    flex: 1 1 0;
  }

  .evstat-sort-field {
    width: auto;
  }

  .evstat-table-region {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .evstat-table,
  .evstat-table tbody {
    display: grid;
    gap: 10px;
    min-width: 0;
  }

  .evstat-table thead {
    display: none;
  }

  .evstat-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 12px 14px 14px;
    border: 1px solid var(--ev-line, #e1e6ec);
    border-radius: var(--evstat-radius);
    background: var(--ev-surface, #fff);
  }

  .evstat-table tbody th,
  .evstat-table tbody td {
    padding: 0;
    border: 0;
  }

  .evstat-table .evstat-col-rank {
    position: absolute;
    top: 12px;
    left: 14px;
    width: auto;
  }

  .evstat-table tbody th {
    grid-column: 1 / -1;
    min-width: 0;
    min-height: 26px;
    padding-left: 38px;
  }

  .evstat-table tbody td[data-label]:not(.evstat-col-rank) {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 2px;
    min-width: 0;
    padding-top: 9px;
    border-top: 1px solid var(--ev-line-subtle, #edf1ef);
    text-align: left;
  }

  .evstat-table tbody td[data-label]:not(.evstat-col-rank)::before {
    content: attr(data-label);
    color: var(--ev-muted, #687586);
    font-size: 11px;
    font-weight: var(--ev-weight-bold, 700);
  }

  .evstat-table .evstat-cell-sub {
    white-space: normal;
  }

  .evstat-table .evstat-energy {
    justify-items: start;
  }

  .evstat-table .evstat-share.is-inline,
  .evstat-table .evstat-status-bar.is-compact {
    width: 100%;
    max-width: none;
    margin: 4px 0 2px;
  }
  .evstat-pagination {
    justify-content: space-between;
  }

  .evstat-method-flow,
  .evstat-formula-grid,
  .evstat-model-notes,
  .evstat-method-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  .evstat-app .evstat-head h1 {
    font-size: 24px;
  }

  .evstat-kpi-value {
    font-size: 20px;
  }

  .evstat-kpi-label {
    font-size: 12px;
  }

  .evstat-tabs [role="tab"] {
    padding: 0 10px;
    font-size: 13px;
  }

  .evstat-tabs [role="tab"] svg {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .evstat-app *,
  .evstat-app *::before,
  .evstat-app *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
