.bp-dashboard {
  --max: 1500px;
  padding-bottom: 54px;
  max-width: calc(100vw - 24px);
  overflow-x: hidden;
}

.bp-dashboard .dash-head {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.bp-dashboard .dash-head h1 {
  letter-spacing: -.055em;
}

.bp-dashboard .source-panel {
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
}

.bp-dashboard .source-panel .logo {
  width: 86px;
  height: 86px;
}

.bp-dashboard .source-panel .source-credit {
  color: var(--muted);
  margin-top: 8px;
  font-size: .92rem;
}

.bp-status {
  margin: 18px 0 0;
  color: var(--orange);
  font-size: .98rem;
  font-weight: 800;
}

.bp-dashboard .muted-note {
  color: var(--muted);
  line-height: 1.45;
}

.bp-kpi-wrap {
  margin-top: 22px;
}

.bp-dashboard .dashboard-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 22px;
}

.bp-dashboard .dashboard-jump-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  color: var(--text);
  font-weight: 800;
}

.bp-dashboard .dashboard-jump-nav a:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.bp-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.bp-card {
  min-width: 0;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  overflow: hidden;
}

.bp-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bp-card-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.18rem;
  letter-spacing: 0;
}

.bp-card-title span,
.bp-select-label {
  color: var(--orange);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bp-card p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.bp-chart-credit {
  margin: 10px 0 0 !important;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}

.bp-chart-wrap {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.bp-chart {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  min-height: 360px;
  overflow: hidden;
  touch-action: pan-y;
}

.bp-chart .js-plotly-plot,
.bp-chart .plot-container,
.bp-chart .svg-container,
.bp-chart .main-svg {
  max-width: 100% !important;
}

.bp-empty-chart {
  min-height: 320px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.bp-select {
  min-width: 220px;
  max-width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

#bpPeerMetric {
  width: min(100%, 460px);
}

.bp-select:focus {
  outline: 2px solid color-mix(in srgb, var(--orange) 60%, transparent);
  outline-offset: 2px;
}

.bp-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 12px 0 16px;
}

.bp-filter-label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--orange);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bp-related-dashboard .related-link {
  width: fit-content;
  margin-top: 4px;
}

.bp-chart.bp-chart-compact {
  min-height: 320px;
}

.bp-inline-controls,
.bp-peer-country-panel {
  margin: 12px 0 14px;
}

.bp-inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.bp-select-small {
  min-width: 180px;
}

.bp-peer-country-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.bp-peer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bp-peer-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
}

.bp-peer-actions button:hover,
.bp-peer-actions button:focus {
  border-color: var(--orange);
  color: var(--orange);
}

.bp-peer-country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.bp-country-option {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  color: var(--text);
  font-size: .88rem;
  font-weight: 750;
}

.bp-country-option input {
  accent-color: var(--orange);
}

.bp-country-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  -webkit-overflow-scrolling: touch;
}

.bp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
}

.bp-table th,
.bp-table td {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  text-align: right;
  vertical-align: top;
}

.bp-table td:first-child {
  min-width: 190px;
}

.bp-table th:first-child,
.bp-table td:first-child {
  text-align: left;
}

.bp-table th {
  color: var(--orange);
  font-weight: 850;
}

.bp-table td {
  color: var(--text);
}

.bp-table td.is-muted {
  color: var(--muted);
}

.bp-dashboard .notes-panel ul {
  margin: 0;
  padding-left: 18px;
}

.bp-dashboard .notes-panel li {
  margin-bottom: 8px;
}

.bp-source-links {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.bp-source-links a {
  color: var(--text);
  font-weight: 700;
}

.bp-source-links a:hover {
  color: var(--orange);
}

.bp-dashboard .related-link {
  color: var(--orange);
  font-weight: 800;
}

.bp-dashboard .plotly .modebar {
  display: none !important;
}

@media (min-width: 1081px) {
  .bp-grid-2 {
    gap: 18px;
  }

  .bp-chart {
    min-height: 520px;
  }

  .bp-chart.bp-chart-tall {
    min-height: 560px;
  }

  .bp-chart.bp-chart-compact {
    min-height: 340px;
  }
}

@media (max-width: 1280px), (pointer: coarse) {
  .bp-dashboard .dash-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .bp-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px), (pointer: coarse) {
  .bp-dashboard .source-panel {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .bp-dashboard .source-panel .logo {
    width: 58px;
    height: 58px;
  }

  .bp-dashboard .dashboard-jump-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }

  .bp-dashboard .dashboard-jump-nav a {
    white-space: nowrap;
    min-height: 36px;
    padding: 0 11px;
  }

  .bp-card {
    padding: 16px;
  }

  .bp-card-title {
    display: block;
  }

  .bp-card-title span,
  .bp-select-label {
    display: block;
    margin-top: 6px;
  }

  .bp-chart {
    min-height: 320px;
  }

  .bp-filter-label {
    min-width: 100%;
  }

  .bp-chart.bp-chart-tall {
    min-height: 440px;
  }

  .bp-chart.bp-chart-compact {
    min-height: 300px;
  }

  #bpRevenuePie,
  #bpSpendingPie {
    min-height: 300px;
  }

  #bpUnder500Chart.bp-chart {
    min-width: 100%;
    min-height: 420px;
  }

  .bp-select {
    width: 100%;
  }

  .bp-select-small {
    min-width: 100%;
  }

  .bp-peer-country-grid {
    grid-template-columns: 1fr 1fr;
    max-height: 320px;
  }

  .bp-country-option {
    padding: 8px;
    font-size: .82rem;
  }

  .bp-table {
    white-space: nowrap;
  }
}
