/* Tables and the one chart on /data/ pages. Loaded only there; tokens come from styles.css. */

/* styles.css gives .prose-wrap no side gutter, so its text meets the screen edge on a phone. */
.wrap.prose-wrap { width: min(var(--prose), 100% - var(--pad-x) * 2); }

.data-wide { margin-top: 8px; }
.data-wide h2 { margin-bottom: 12px; }

.table-scroll { overflow-x: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.data-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 0.93rem; line-height: 1.4; }
.data-table caption { caption-side: top; text-align: left; padding: 12px 14px 8px; color: var(--muted); font-size: 0.88rem; }
.data-table th, .data-table td { padding: 9px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.data-table thead th { font-size: 0.8rem; font-weight: 700; color: var(--muted); background: var(--bg); }
.data-table tbody th { font-weight: 600; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table-small { min-width: 480px; }
.data-none { color: var(--muted); }

.data-download { font-size: 0.95rem; margin: 10px 0 0; color: var(--muted); }

.rate-chart { margin: 26px 0 8px; }
.rate-chart figcaption { font-weight: 700; margin-bottom: 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.86rem; color: var(--muted); margin-bottom: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch-gst, .bar-gst { background: #08795a; }
.swatch-provincial, .bar-provincial { background: #c8701b; }

.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 210px) 1fr; gap: 10px; align-items: center; font-size: 0.9rem; }
.bar-name { color: var(--ink); }
/* The value sits outside the longest bar, so the track keeps room for it. */
.bar-track { display: flex; align-items: center; gap: 2px; height: 20px; padding-right: 64px; position: relative; }
.bar-gst, .bar-provincial { height: 100%; display: block; flex: none; }
.bar-gst { border-radius: 0; }
.bar-gst:nth-last-child(2) { border-radius: 0 4px 4px 0; }
.bar-provincial { border-radius: 0 4px 4px 0; }
.bar-value { font-size: 0.86rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; }

@media (max-width: 560px) {
  .bar-row { grid-template-columns: 1fr; gap: 2px; }
  .bars { gap: 10px; }
}

.source-list { padding-left: 1.2em; }
.article .prose .source-list li { font-size: 0.95rem; margin-bottom: 0.4em; }
