.nav { font-size: 12px; margin-top: 4px; }
.nav a { color: #06c; text-decoration: none; }
.nav a:hover { text-decoration: underline; }

/* Width is applied from JS to match the index matrix width (see stats.js). */

.chart-wrap { width: 100%; margin: 0 0 16px 0; border: 1px solid #ddd; background: #fff; padding: 10px 12px; border-radius: 2px; }
#chart { display: block; width: 100%; height: auto; }
#chart .row-stripe { fill: #fafafa; }
#chart .bar-default { fill: #222; }
#chart .bar-optin { fill: #b45; }
#chart .bar-svc { fill: #06c; }
#chart .bar-default:hover, #chart .bar-optin:hover { fill-opacity: 0.75; }
#chart .axis { stroke: #bbb; stroke-width: 1; }
#chart .grid { stroke: #eee; stroke-width: 1; stroke-dasharray: 2 3; }
#chart .grid-major { stroke: #d8d8d8; stroke-width: 1; }
#chart .tick-label { font: 9px -apple-system, system-ui, sans-serif; fill: #666; font-variant-numeric: tabular-nums; }
#chart .axis-title { font: 10px -apple-system, system-ui, sans-serif; fill: #444; font-weight: 600; }
#chart .region-label { font: 9px/1 -apple-system, system-ui, sans-serif; fill: #222; font-weight: 500; }
#chart .region-label.optin { fill: #b45; }
#chart .value-label { font: 9px -apple-system, system-ui, sans-serif; fill: #333; font-variant-numeric: tabular-nums; font-weight: 600; }
#chart .value-label.inside { fill: #fff; }

.stats-table-wrap { overflow-x: auto; border: 1px solid #ddd; max-height: calc(100vh - 200px); overflow-y: auto; }
#stats-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
#stats-table th, #stats-table td { padding: 4px 10px; border-bottom: 1px solid #eee; text-align: left; white-space: nowrap; }
#stats-table thead th { position: sticky; top: 0; background: #f5f5f5; font-weight: 600; z-index: 1; cursor: pointer; user-select: none; }
#stats-table thead th:hover { background: #eaeaea; }
#stats-table td.num, #stats-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
#stats-table tr.optin td.region, #stats-table tr.optin td.name { color: #b45; }
#stats-table tr:hover td { background: #eef6ff; }
.svcreg-swatch { display: inline-block; padding: 0 6px; background: #06c; color: #fff; border-radius: 2px; font-weight: 600; font-size: 11px; }
.svc-cell { display: flex; flex-direction: column; }
.svc-title { font-weight: 600; }
.svc-slug { color: #666; font-size: 10px; }
.cat-tag { display: inline-block; padding: 1px 6px; background: #eee; border-radius: 3px; font-size: 10px; color: #555; }
.bar-cell { position: relative; min-width: 160px; }
.bar-cell .bar-track { background: #f0f0f0; border-radius: 2px; height: 10px; width: 160px; overflow: hidden; }
.bar-cell .bar-fill { height: 100%; background: #222; }
tr.optin .bar-cell .bar-fill { background: #b45; }
.svcreg .bar-cell .bar-fill { background: #06c; }
