/* MDWDS provides controls and base styling; these rules match the reference layout. */
body {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px 20px;
}

main {
  padding-bottom: 2rem;
}

.hero {
  margin-bottom: 28px;
  padding-bottom: 32px;
  border-bottom: 4px solid #005ea2;
}

.eyebrow {
  margin: 0 0 12px;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  font-weight: 400;
  line-height: 1.3;
}

.hero__lede {
  margin: 20px 0 0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px 20px;
  margin-bottom: 20px;
  padding: 24px;
  background: #f8f9fa;
}

.filters,
.panel {
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.field {
  min-width: 0;
}

.field .usa-label {
  margin: 0 0 8px;
}

.field .usa-select {
  max-width: none;
  margin-top: 0;
}

.view-controls,
.table-tabs,
.table-toolbar,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.view-controls,
.table-toolbar {
  justify-content: space-between;
}

.view-controls {
  margin-bottom: 24px;
}

.table-tabs {
  gap: 8px;
}

.table-tabs .usa-button,
.table-actions .usa-button {
  margin: 0;
  min-height: 44px;
}

.table-tabs .usa-button {
  border-radius: 4px 4px 0 0;
  border-bottom: 3px solid transparent;
}

.table-tabs .usa-button[aria-pressed="true"] {
  border-bottom-color: #162e51;
}

.table-tabs .usa-button[aria-pressed="false"] {
  background: transparent;
  color: #005ea2;
}

.table-tabs .usa-button:hover {
  background: #f0f4ff;
  color: #1a4480;
}

.reset.usa-button {
  width: auto;
  margin: 0;
}

.table-panel {
  overflow: hidden;
}

.table-toolbar {
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
}

.table-toolbar h2 {
  margin: 0;
}

.context,
.table-help {
  margin: 4px 0 0;
}

.table-search {
  padding: 16px 20px;
}

.table-search .usa-input {
  margin: 0;
  max-width: 310px;
}

.table-scroll {
  min-height: 290px;
  overflow: auto;
}

.table-scroll .usa-table {
  width: 100%;
  min-width: 900px;
  margin: 0;
}

.table-scroll .usa-table th,
.table-scroll .usa-table td {
  padding: 14px 12px;
  border-color: #dee2e6;
  text-align: left;
}

.table-scroll .usa-table thead th {
  background: #dfe1e2;
}

.table-scroll .usa-table tbody tr>* {
  background: #fff;
}

.table-scroll .usa-table tbody tr:nth-child(even)>* {
  background: #f8f9fa;
}

.table-scroll .usa-table tbody th {
  font-weight: 400;
}

.table-scroll .usa-table .state-row>* {
  font-weight: 700;
}

.maryland-table thead button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-note {
  margin: 0;
  padding: 16px 20px;
}

.table-note--list {
  padding-left: 40px;
  list-style-type: disc;
}

.table-note--list li + li {
  margin-top: 4px;
}

.details {
  margin-top: 24px;
  padding: 20px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 20px;
}

.resource-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

@media (max-width: 700px) {
  body {
    padding: 12px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters,
  .table-toolbar,
  .table-search,
  .details {
    padding: 16px;
  }

  .table-tabs .usa-button {
    flex: 1 1 45%;
  }
}

@media print {

  .usa-skipnav,
  .filters,
  .view-controls,
  .table-actions,
  .table-search,
  .details,
  .table-help {
    display: none;
  }

  body {
    padding: 0;
  }

  .table-panel,
  .table-scroll {
    overflow: visible;
  }

  .table-scroll .usa-table {
    min-width: 0;
    font-size: 7.5pt;
  }

  .table-scroll .usa-table th,
  .table-scroll .usa-table td {
    padding: 4pt;
  }

  tr {
    break-inside: avoid;
  }
}
.trend-panel { margin-top: 24px; overflow: hidden; }
.trend-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 0 20px 20px; }
.trend-charts figure { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.trend-charts h3 { margin: 0 0 8px; }
.trend-charts figure > div { margin-top: auto; }
.trend-charts svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend-charts svg text { fill: #454545; font: 13px Arial, sans-serif; }
.chart-legend { display: flex; gap: 20px; margin: 0 0 8px; font-size: .9rem; }
.chart-legend span:first-child { color: #005ea2; }
.chart-legend span:last-child { color: #a34b00; }
.chart-point:focus { outline: 2px solid #162e51; outline-offset: 4px; }
.chart-empty { min-height: 180px; display: grid; place-content: center; color: #454545; }
.trend-panel .table-scroll { min-height: 0; }
.trend-panel .table-scroll .usa-table { min-width: 620px; }
.trend-panel .usa-table .selected-year > * { background: #e7f2f8; font-weight: 700; }
@media (max-width: 900px) { .trend-charts { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .trend-charts { padding: 0 12px 16px; } }
@media print {
 .trend-panel { overflow: visible; }
 .trend-charts figure { break-inside: avoid; }
 .trend-panel .table-scroll .usa-table { min-width: 0; }
}

.chart-value { min-height: 2.5em; margin: 8px 0 0; color: #454545; }

.pfa-share { margin: 0; padding: 20px; border-bottom: 1px solid #dee2e6; }
.pfa-share h3 { margin: 0; }
.pfa-share-layout { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; margin-top: 20px; }
.pfa-share-pie { width: 220px; max-width: 100%; aspect-ratio: 1; flex-shrink: 0; }
.pfa-share-pie[hidden] { display: none; }
.pfa-share-pie svg { display: block; width: 100%; height: auto; }
.pfa-share-values { display: flex; flex-wrap: wrap; gap: 16px 48px; }
.pfa-share-values > div { display: flex; flex-direction: column; gap: 4px; }
.pfa-share-values strong { font-size: 1.5rem; }
.pfa-share-label { display: flex; align-items: center; gap: 8px; }
.pfa-share-swatch { width: 24px; height: 24px; flex-shrink: 0; }
.pfa-share-note { margin: 16px 0 0; }
@media (max-width: 700px) { .pfa-share { padding: 16px; } }
@media print { .pfa-share { break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* Current/constant dollars toggle shares the bar above the table with the search box. */
.table-search { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
/* .table-tabs sets display: flex, which would otherwise override the hidden attribute. */
.dollar-toggle[hidden] { display: none; }
