/* House of Embers: chart styles for core/charts.py (BRAND.md "The bar", section 4). Tokens only, through custom properties; no animation.
   A chart sets its colour with one class (ch-ember, ch-r-rare ...) that defines --c; shapes and swatches read var(--c). */

/* ---- colour classes: --c ---- */
.ch-ember { --c: var(--ember, #FF6A1A); }
.ch-chits { --c: var(--chits, #F5B841); }
.ch-embers { --c: var(--embers, #E879F9); }
.ch-xp { --c: var(--xp, #86EFAC); }
.ch-r-common { --c: var(--rarity-common, #E9E4DF); }
.ch-r-uncommon { --c: var(--rarity-uncommon, #6EE787); }
.ch-r-rare { --c: var(--rarity-rare, #8FA8FF); }
.ch-r-radiant { --c: var(--rarity-radiant, #F07CF5); }
.ch-r-legendary { --c: var(--rarity-legendary, #FFB547); }
.ch-t-mining { --c: var(--trade-mining, #F2A93B); }
.ch-t-fishing { --c: var(--trade-fishing, #2EC4B6); }
.ch-t-farming { --c: var(--trade-farming, #7BCB4B); }
.ch-t-gathering { --c: var(--trade-gathering, #F37BC0); }
.ch-other { --c: var(--text-3, #8F8277); }
.ch-dim { --c: color-mix(in srgb, var(--text, #F7EFE7) 24%, transparent); }

/* ---- the figure and the svg ---- */
.ch-fig { margin: var(--sp-4, 16px) 0 var(--sp-5, 24px); min-width: 0; }
.ch { --c: var(--ember, #FF6A1A); display: block; width: 100%; height: auto; overflow: visible; color: var(--text-2, #C9BCB0);
  font: 500 12px/1.2 var(--sans, "Geist", system-ui, sans-serif); font-variant-numeric: tabular-nums; }

/* text: labels in text-2, values and highlights in text, axis text in text-3 (all 4.5:1 or better on the ground and on --surface) */
.ch text { font: inherit; }
.ch-l { fill: var(--text-2, #C9BCB0); }
.ch-v { fill: var(--text, #F7EFE7); font-weight: 600; }
.ch-hl { fill: var(--text, #F7EFE7); font-weight: 600; paint-order: stroke; stroke: var(--ch-halo, var(--surface, #1B1512)); stroke-width: 4px; stroke-linejoin: round; }
.ch-ax { fill: var(--text-3, #8F8277); }

/* shapes */
.ch-track { fill: color-mix(in srgb, var(--text, #F7EFE7) 9%, transparent); }
.ch-bar, .ch-rung { fill: var(--c); }
.ch-grid { stroke: var(--border, rgba(255,214,180,.08)); stroke-width: 1; }
.ch-axis { stroke: var(--border-strong, rgba(255,214,180,.14)); stroke-width: 1; }
.ch-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--c); fill-opacity: .14; stroke: none; }
.ch-pt { fill: var(--c); }
.ch-hdot { fill: var(--c); stroke: var(--text, #F7EFE7); stroke-width: 2; }
.ch-hlv { stroke: var(--c); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-hstep { stroke: var(--text, #F7EFE7); stroke-width: 3; stroke-linecap: round; }
.ch-mk { stroke: var(--c); stroke-width: 3; stroke-linecap: round; }
.ch-br { stroke: var(--c); stroke-width: 2; stroke-linecap: round; }
.ch-hit { fill: transparent; }
.ch-hit:hover { fill: color-mix(in srgb, var(--text, #F7EFE7) 6%, transparent); }

/* ---- the legend row (stacked) ---- */
.ch-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: var(--sp-3, 12px) 0 0; padding: 0;
  font: 500 13px/1.3 var(--sans, "Geist", system-ui, sans-serif); color: var(--text-2, #C9BCB0); }
.ch-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ch-sw { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.ch-lv { color: var(--text, #F7EFE7); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- the inline bar for a table cell: bar first, then the number in a fixed tabular box so a column of them lines up ---- */
:where(.ch-ib) { --c: var(--ember, #FF6A1A); }   /* zero specificity: a colour class on the same svg (ch-chits) must win */
.ch-ib { display: inline-block; flex: none; vertical-align: middle; height: 8px; }
.ch-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.ch-cn { min-width: 7ch; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- the table fallback: the house table (eyebrow header, hairlines, tabular numbers), compact ---- */
.ch-tw { margin-top: var(--sp-3, 12px); overflow-x: auto; }
.ch-tw-s { max-height: 20rem; overflow-y: auto; }
.ch-fig .ch-table { width: 100%; border-collapse: collapse; font: 400 14px/1.4 var(--sans, "Geist", system-ui, sans-serif); font-variant-numeric: tabular-nums; }
.ch-fig .ch-table th, .ch-fig .ch-table td { height: auto; padding: 6px 16px 6px 0; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border, rgba(255,214,180,.08)); color: var(--text-2, #C9BCB0); }
.ch-fig .ch-table thead th { padding-top: 8px; padding-bottom: 8px; border-bottom-color: var(--border-strong, rgba(255,214,180,.14));
  font: 600 12px/1.35 var(--sans, "Geist", system-ui, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3, #8F8277); white-space: nowrap; }
.ch-fig .ch-table tbody th { font: 500 14px/1.4 var(--sans, "Geist", system-ui, sans-serif); letter-spacing: 0; text-transform: none; white-space: normal; color: var(--text, #F7EFE7); }
.ch-fig .ch-table .num { text-align: right; padding-right: 0; white-space: nowrap; }
.ch-fig .ch-table td.num { color: var(--text, #F7EFE7); }
.ch-fig .ch-table tbody tr:last-child th, .ch-fig .ch-table tbody tr:last-child td { border-bottom: 0; }
.ch-fig .ch-table tr.ch-cur th, .ch-fig .ch-table tr.ch-cur td { color: var(--text, #F7EFE7); background: color-mix(in srgb, var(--ember, #FF6A1A) 12%, transparent); font-weight: 600; }
.ch-fig .ch-table tr.ch-cur th { padding-left: 8px; }
.ch-fig .ch-table tr.ch-cur td.num { padding-right: 8px; }
.ch-fig .ch-table thead th:first-child { padding-left: 0; }
.ch-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ch-tw:focus-visible { outline: 2px solid var(--ember, #FF6A1A); outline-offset: 2px; }

/* ---- a chart that fills its column: three SVGs drawn at three widths, the one that fits the column shown (core.charts.responsive) ---- */
.ch-resp { container-type: inline-size; }
.ch-resp .ch { max-width: none !important; }   /* the inline max-width is the natural width of one drawing */
.ch-resp .ch-w { display: none; }
.ch-resp .ch-w0 { display: block; }
@container (min-width: 440px) { .ch-resp .ch-w0 { display: none; } .ch-resp .ch-w1 { display: block; } }
@container (min-width: 620px) { .ch-resp .ch-w1 { display: none; } .ch-resp .ch-w2 { display: block; } }

/* a table the page already has: this one stays for screen readers only, and a quiet link points at the page's own */
.ch-tw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ch-tablelink { margin: var(--sp-2, 8px) 0 0; font-size: 14px; }
.ch-tablelink a { color: var(--text-2, #C9BCB0); }
