@font-face {
  font-family: "Open Sans";
  src: url("./open-sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("./open-sans-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: "Open Sans", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1d1f21;
  background: #fff;
  --muted: #555;
  --border: #dee2e6;
  --control-border: #ccc;
  --accent: #005a95;
  --control: #f8f8f8;
  --surface: #f9f9f9;
  --hover: #eee;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--accent); }
a:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.masthead { background: #123f73; border-bottom: 3px solid #4692ca; color: #fff; }
.masthead-inner {
  max-width: 1470px; margin: auto; padding: 1.125rem clamp(1rem, 3vw, 2.75rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem;
}
.masthead a { color: inherit; font-size: 1.15rem; font-weight: 650; text-decoration: none; }
.masthead span { font-size: .9rem; color: #e9edf1; }
.dashboard {
  max-width: 1470px; margin: auto; padding: clamp(1rem, 3vw, 2.75rem);
  display: grid; grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  align-items: start; gap: clamp(1rem, 3vw, 2.75rem);
}
.sidebar h2 { font-size: .95rem; margin: .25rem 0 .65rem .75rem; color: var(--muted); }
.chart-tag-filter {
  display: grid; gap: .35rem; margin: 0 0 .65rem; color: var(--muted);
  font-size: .875rem; font-weight: 600;
}
.chart-tag-filter select { width: 100%; font-size: .9rem; }
#charts { display: grid; gap: .25rem; }
#charts a {
  padding: .65rem .75rem; border-radius: .35rem;
  text-decoration: none; font-weight: 550; line-height: 1.3;
}
#charts a:hover { background: var(--hover); }
#charts a[aria-current="page"] { color: #fff; background: var(--accent); }
.view { min-width: 0; }
.view-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.4rem); line-height: 1.14; letter-spacing: -.035em; }
.view-header p { margin: .55rem 0 0; color: var(--muted); line-height: 1.45; }
.link-button {
  display: inline-block; width: max-content; max-width: 100%; white-space: nowrap;
  padding: 6px 12px; border: 1px solid var(--control-border); border-radius: 4px;
  background: var(--control); color: inherit; font-size: 14px; text-decoration: none;
}
.link-button:hover { background: #e6e6e6; border-color: #adadad; }
.controls { display: flex; align-items: start; flex-wrap: wrap; gap: .65rem; margin: 1.25rem 0 .8rem; }
.controls:empty { display: none; }
select {
  width: min(100%, 30rem); min-width: 0; appearance: none; font: inherit;
}
.figure { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: .55rem; overflow: hidden; }
.chart-scroll { overflow-x: auto; }
.chart-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.figure-footer {
  color: var(--muted); border-top: 1px solid var(--border); font-size: .875rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem;
  padding: .6rem .85rem; font-variant-numeric: tabular-nums;
}
.figure-footer [data-error] { color: #a22626; }
.embed .masthead, .embed .sidebar, .embed .view-header, .embed-compact .controls, .embed .figure-footer { display: none; }
.embed .dashboard { display: block; padding: 0; max-width: none; }
.embed .figure { border: 0; border-radius: 0; }
.embed .figure:has([data-error]) .figure-footer { display: block; }
@media (max-width: 800px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  #charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar h2 { margin-left: 0; }
  .view-header { flex-wrap: wrap; gap: .75rem; }
}

button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.filter {
  width: clamp(11rem, 30%, 17rem); min-width: 0; display: grid; gap: .35rem;
  font-size: .875rem; font-weight: 600; color: var(--muted); position: relative;
}
.filter > select {
  width: 100%; font-weight: 400; text-overflow: ellipsis;
}
select, .picker > summary {
  color: #000; border: 1px solid var(--control); border-radius: 4px;
  padding: 8px 2rem 8px 12px; font-size: 15px;
  background: var(--control) var(--caret) no-repeat right .55rem center / 1rem;
}
.picker > summary { list-style: none; font-weight: 400; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker > summary::-webkit-details-marker { display: none; }
.picker-panel {
  position: absolute; z-index: 6; width: max-content; min-width: 100%; max-width: min(33rem, 84vw);
  padding: .55rem; margin-top: .25rem; border: 1px solid var(--border); border-radius: .35rem;
  box-shadow: 0 .25rem 1rem #0002; background: #fff;
}
.picker-panel input[type="search"], .table-tools input[type="search"] {
  padding: .4rem; width: 100%; font: inherit; color: inherit;
  border: 1px solid var(--border); border-radius: .25rem;
}
.picker-actions { display: flex; gap: .35rem; margin-top: .35rem; }
.picker-actions button, .table-tools button {
  border: 1px solid var(--control-border); background: #fff; color: inherit;
  padding: .32rem .55rem; border-radius: .25rem;
}
.picker-options { max-height: 15rem; overflow-y: auto; margin-top: .35rem; }
.picker-options label { display: flex; align-items: baseline; gap: .4rem; padding: .2rem; }
.picker-options label:hover { background: var(--hover); }
.picker-options input, .stack-control input { accent-color: var(--accent); }
.view-tools {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: end;
  margin: .75rem 0 0; border-bottom: 1px solid var(--border);
}
.view-tools .link-button { margin-bottom: 4px; }
[role="tablist"] { display: flex; gap: 2px; flex-wrap: wrap; }
[role="tab"] {
  margin-bottom: -1px; padding: 8px 16px; border: 1px solid transparent;
  border-radius: 4px 4px 0 0; background: transparent; color: #007bc2;
}
[role="tab"]:hover { background: var(--hover); }
[role="tab"][aria-selected="true"] { background: #fff; border-color: var(--border) var(--border) #fff; color: #000; }
.view-tools:not([hidden]) ~ .figure { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.stack-control { display: flex; align-items: center; gap: .35rem; margin: .5rem .7rem 0; width: fit-content; }
#plot { width: 100%; height: max(25rem, var(--chart-height, 32rem)); min-width: var(--chart-width, 0); line-height: 1.5; }
.embed-compact .view-tools { display: none; }
.embed-compact #panel-visualization { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.embed-compact .chart-scroll { flex: 1; min-height: 0; overflow-y: hidden; }
.embed-compact #plot { height: 100%; }
.embed .stack-control { margin-bottom: .25rem; }
.source-legend { display: flex; flex-wrap: wrap; gap: .125rem .4rem; padding: 0 .5rem .5rem; }
.source-legend button {
  display: inline-flex; align-items: baseline; gap: .4rem; max-width: 100%; padding: .25rem .4rem;
  border: 0; border-radius: 4px; background: transparent; color: inherit;
  font-size: .875rem; text-align: left; overflow-wrap: anywhere;
}
.source-legend button:hover, .source-legend button[aria-pressed="true"] { background: var(--hover); }
.source-legend button[data-muted] { color: var(--muted); }
.source-legend button::before {
  content: ""; flex: 0 0 .85rem; border-top: 3px solid var(--source-color);
  align-self: start; margin-top: .55em;
}
.source-legend button[data-muted]::before { opacity: .35; }
.table-panel { padding: .8rem; }
.table-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .55rem; margin-bottom: .6rem; }
.table-tools label { display: flex; align-items: center; gap: .4rem; font-size: .88rem; }
.table-tools select { width: auto; padding-block: .35rem; font-size: .88rem; }
.pagination { justify-content: end; margin: .6rem 0 0; font-size: .88rem; }
.pagination span { margin-right: auto; }
.table-scroll { max-height: 43rem; overflow: auto; }
.table-scroll table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .88rem; }
.table-scroll th, .table-scroll td {
  padding: .55rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border); white-space: pre-line;
}
.table-scroll th:first-child, .table-scroll td:first-child { border-left: 1px solid var(--border); }
.table-scroll thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); border-top: 1px solid var(--border);
}
.table-scroll tr:nth-child(even) { background: var(--surface); }
#panel-metadata .data-grid thead th:first-child { left: 0; z-index: 3; }
#panel-metadata .data-grid tbody td:first-child { position: sticky; left: 0; background: var(--surface); }
.data-grid th { white-space: nowrap; }
.data-grid th button { color: inherit; background: none; border: 0; padding: 0; font-weight: 650; white-space: inherit; }
.data-grid th[aria-sort="ascending"] button::after { content: " ↑"; }
.data-grid th[aria-sort="descending"] button::after { content: " ↓"; }
.table-scroll td:has(details), .table-scroll td:has(a) { min-width: 15rem; max-width: 28rem; overflow-wrap: anywhere; }
.table-scroll summary { cursor: pointer; }
.metadata-grid td { min-width: 18rem; }
.metadata-grid th[scope="row"] { min-width: 11rem; background: var(--surface); position: sticky; left: 0; }
.metadata-grid thead th:first-child { left: 0; z-index: 3; }
.metadata-columns thead th:first-child { left: auto; }
.metadata-grid dl { margin: 0 0 .75rem; }
.metadata-grid dl + dl { border-top: 1px solid var(--border); padding-top: .5rem; }
.metadata-grid dt { font-weight: 650; }
.metadata-grid dd { margin: .2rem 0 .6rem; }

@media (max-width: 800px) {
  .filter { width: calc(50% - .4rem); }
  .filter:nth-child(even) .picker-panel { right: 0; }
  .table-tools { justify-content: flex-start; }
}
@media (max-width: 380px) {
  /* Keep the configured ticks readable in narrow embeds. */
  .embed body:not(.narrow-inequality) #plot :is(.xaxislayer-above, .xaxislayer-below) text { font-size: 16px !important; }
}
@media (max-width: 360px) {
  .filter { width: 100%; }
  .filter:nth-child(even) .picker-panel { right: auto; }
}
.narrow-inequality .controls { gap: .45rem; margin-top: .75rem; }
.narrow-inequality .filter { width: calc(50% - .25rem); }
.narrow-inequality .filter:nth-child(even) .picker-panel { right: 0; }
.narrow-inequality:not(.embed-compact) #plot { height: clamp(360px, 100vw, 430px); }
