:where(.pfc) {
  /* Each color reads the @profullstack/css token first, so a chart on a page that uses
     @profullstack/css matches it (light, dark and data-theme) with no extra CSS. */
  --pfc-text: var(--pf-color-ink, #1f2328);
  --pfc-muted: var(--pf-color-ink-muted, #59636e);
  --pfc-bg: var(--pf-color-surface, #ffffff);
  --pfc-grid: var(--pf-color-border, rgba(31, 35, 40, 0.1));
  --pfc-axis: var(--pf-color-ink-muted, rgba(31, 35, 40, 0.35));
  --pfc-crosshair: var(--pf-color-ink-muted, rgba(31, 35, 40, 0.6));
  --pfc-up: var(--pf-color-success, #0b7a5c);
  --pfc-down: var(--pf-color-danger, #d1242f);
  --pfc-focus: var(--pf-color-focus, #0969da);
  --pfc-radius: var(--pf-radius-md, 8px);
  color: var(--pfc-text);
  font: 13px/1.4 var(--pf-font-sans, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  position: relative;
  display: block;
  min-width: 0;
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"]) .pfc) {
    --pfc-text: var(--pf-color-ink, #e6edf3);
    --pfc-muted: var(--pf-color-ink-muted, #9198a1);
    --pfc-bg: var(--pf-color-surface, #0d1117);
    --pfc-grid: var(--pf-color-border, rgba(230, 237, 243, 0.1));
    --pfc-axis: var(--pf-color-ink-muted, rgba(230, 237, 243, 0.35));
    --pfc-crosshair: var(--pf-color-ink-muted, rgba(230, 237, 243, 0.6));
    --pfc-up: var(--pf-color-success, #26a69a);
    --pfc-down: var(--pf-color-danger, #f7525f);
    --pfc-focus: var(--pf-color-focus, #4493f8);
    --pfc-c0: #56B4E9; --pfc-c1: #F0A050; --pfc-c2: #3CC79A; --pfc-c3: #E08FC0;
    --pfc-c4: #F0C040; --pfc-c5: #8FD3F5; --pfc-c6: #B79CE0; --pfc-c7: #A8A8A8;
  }
}
:where([data-theme="dark"] .pfc, .pfc[data-theme="dark"]) {
  --pfc-text: var(--pf-color-ink, #e6edf3); --pfc-muted: var(--pf-color-ink-muted, #9198a1);
  --pfc-bg: var(--pf-color-surface, #0d1117); --pfc-grid: var(--pf-color-border, rgba(230, 237, 243, 0.1));
  --pfc-axis: var(--pf-color-ink-muted, rgba(230, 237, 243, 0.35));
  --pfc-crosshair: var(--pf-color-ink-muted, rgba(230, 237, 243, 0.6));
  --pfc-up: var(--pf-color-success, #26a69a); --pfc-down: var(--pf-color-danger, #f7525f);
  --pfc-focus: var(--pf-color-focus, #4493f8);
  --pfc-c0: #56B4E9; --pfc-c1: #F0A050; --pfc-c2: #3CC79A; --pfc-c3: #E08FC0;
  --pfc-c4: #F0C040; --pfc-c5: #8FD3F5; --pfc-c6: #B79CE0; --pfc-c7: #A8A8A8;
}
:where(.pfc-figure) { margin: 0; }
:where(.pfc-title) { font-weight: 600; font-size: 1.05em; margin: 0 0 0.5em; }
:where(.pfc-plot, .pfc-stage) { position: relative; border-radius: var(--pfc-radius); outline: none; }
:where(.pfc-plot, .pfc-stage):focus-visible { box-shadow: 0 0 0 2px var(--pfc-focus); }
:where(.pfc-svg) { display: block; overflow: visible; max-width: 100%; height: auto; }
:where(.pfc-axis text) { fill: var(--pfc-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
:where(.pfc-grid) { stroke: var(--pfc-grid); }
:where(.pfc-zero, .pfc-domain) { stroke: var(--pfc-axis); }
:where(.pfc-line) { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
:where(.pfc-area) { fill-opacity: 0.18; stroke: none; }
:where(.pfc-bar) { transition: opacity 0.15s; }
:where(.pfc-point) { fill-opacity: 0.8; stroke: var(--pfc-bg); stroke-width: 1; }
:where(.pfc-guide) { stroke: var(--pfc-crosshair); stroke-dasharray: 3 3; }
:where(.pfc-active) { fill: var(--pfc-bg); stroke-width: 2.5; }
:where(.pfc-band) { fill: var(--pfc-text); opacity: 0.06; }
:where(.pfc-slice) { stroke: var(--pfc-bg); stroke-width: 1.5; }
:where(.pfc-slice-label) { fill: #fff; font-size: 11px; font-weight: 600; paint-order: stroke; stroke: rgba(0,0,0,0.35); stroke-width: 2px; }
:where(.pfc-center-value) { fill: var(--pfc-text); font-size: 20px; font-weight: 700; }
:where(.pfc-center-label) { fill: var(--pfc-muted); font-size: 12px; }
:where(.pfc-tooltip) {
  position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none;
  background: var(--pfc-bg); color: var(--pfc-text); border: 1px solid var(--pfc-grid);
  border-radius: 6px; padding: 6px 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
:where(.pfc-tooltip i, .pfc-legend i) { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
:where(.pfc-tooltip b) { margin-left: 4px; }
:where(.pfc-legend) { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 6px; }
:where(.pfc-legend button, .pfc-toolbar button, .pfc-toolbar select, .pfc-menu summary) {
  font: inherit; font-size: 12px; color: inherit; background: transparent; cursor: pointer;
  border: 1px solid var(--pfc-grid); border-radius: 6px; padding: 3px 8px; min-height: 28px;
  display: inline-flex; align-items: center; gap: 6px;
}
:where(.pfc-legend button[aria-pressed="false"]) { opacity: 0.45; text-decoration: line-through; }
:where(.pfc-legend button:focus-visible, .pfc-toolbar :focus-visible, .pfc-table summary:focus-visible) { outline: 2px solid var(--pfc-focus); outline-offset: 1px; }
:where(.pfc-table) { margin-top: 6px; font-size: 12px; }
:where(.pfc-table summary) { cursor: pointer; color: var(--pfc-muted); width: max-content; }
:where(.pfc-table-scroll) { max-height: 260px; overflow: auto; }
:where(.pfc-table table) { border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 4px; }
:where(.pfc-table th, .pfc-table td) { padding: 3px 10px; border-bottom: 1px solid var(--pfc-grid); text-align: right; }
:where(.pfc-table th:first-child) { text-align: left; }
:where(.pfc-sr) { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:where(.pfc-sparkline) { display: inline-block; vertical-align: middle; }
:where(.pfc-spark) { display: block; }

/* trading chart */
:where(.pfc-toolbar) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
:where(.pfc-group) { display: inline-flex; gap: 2px; flex-wrap: wrap; }
:where(.pfc-group button[aria-pressed="true"]) { background: var(--pfc-text); color: var(--pfc-bg); border-color: var(--pfc-text); }
:where(.pfc-toolbar select) { background: var(--pfc-bg); }
:where(.pfc-menu) { position: relative; }
:where(.pfc-menu summary) { list-style: none; }
:where(.pfc-menu summary::-webkit-details-marker) { display: none; }
:where(.pfc-menu-list) {
  position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 170px;
  background: var(--pfc-bg); border: 1px solid var(--pfc-grid); border-radius: 8px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); display: grid; gap: 2px;
}
:where(.pfc-menu-list label) { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
:where(.pfc-menu-list label:hover) { background: var(--pfc-grid); }
:where(.pfc-live) { color: var(--pfc-up); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
:where(.pfc-live)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pfc-pulse 1.4s infinite; }
@keyframes pfc-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { :where(.pfc-live)::before { animation: none; } }
:where(.pfc-canvas) { display: block; touch-action: none; cursor: crosshair; }
:where(.pfc-ohlc) {
  position: absolute; top: 4px; left: 8px; right: 80px; pointer-events: none; font-size: 12px;
  font-variant-numeric: tabular-nums; line-height: 1.5; text-shadow: 0 0 3px var(--pfc-bg);
}
:where(.pfc-ohlc b) { font-weight: 600; margin-right: 4px; }
:where(.pfc-ind) { display: flex; flex-wrap: wrap; gap: 0 10px; }
:where(.pfc-muted) { color: var(--pfc-muted); }
:where(.pfc-up) { color: var(--pfc-up); }
:where(.pfc-down) { color: var(--pfc-down); }
/* more charts */
:where(.pfc-on) { stroke: var(--pfc-text); stroke-width: 2; }
:where(.pfc-cell) { stroke: transparent; }
:where(.pfc-cell-label, .pfc-bar-value, .pfc-funnel-value) { font-size: 11px; font-variant-numeric: tabular-nums; }
:where(.pfc-bar-value, .pfc-funnel-value, .pfc-funnel-label, .pfc-radar-label) { fill: var(--pfc-text); font-size: 12px; }
:where(.pfc-scale) { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--pfc-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
:where(.pfc-scale i) { display: inline-block; width: 140px; height: 10px; border-radius: 3px; }
:where(.pfc-steps b) { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
:where(.pfc-track) { fill: var(--pfc-grid); }
:where(.pfc-radar-area) { fill-opacity: 0.15; stroke-width: 2; }
:where(.pfc-tm-group) { fill: none; stroke: var(--pfc-grid); }
:where(.pfc-tm-group-label) { fill: var(--pfc-text); font-size: 11px; font-weight: 600; }
:where(.pfc-tm-leaf) { stroke: var(--pfc-bg); }
:where(.pfc-tm-value) { font-weight: 400; }
:where(.pfc-box) { stroke: currentColor; stroke-width: 1.5; }
:where(.pfc-box-body) { fill: currentColor; fill-opacity: 0.18; }
:where(.pfc-box-median) { stroke-width: 3; }
:where(.pfc-box-outlier) { fill: var(--pfc-bg); }
:where(.pfc-bubble) { fill-opacity: 0.55; stroke: var(--pfc-bg); }
:where(.pfc-depth-area) { fill-opacity: 0.18; }
:where(.pfc-depth-line) { fill: none; stroke-width: 2; }
:where(.pfc-depth-head) { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
:where(.pfc-stat) { display: grid; gap: 2px; }
:where(.pfc-stat-label) { color: var(--pfc-muted); font-size: 13px; }
:where(.pfc-stat-value) { font-size: 2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
:where(.pfc-stat-delta) { font-size: 13px; font-weight: 600; }
@media (forced-colors: active) {
  :where(.pfc-line) { stroke: CanvasText !important; }
  :where(.pfc-bar, .pfc-slice, .pfc-point) { forced-color-adjust: none; }
  :where(.pfc-group button[aria-pressed="true"]) { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
