/*
 * Charts from the article editor (App\Filament\RichBlocks\ChartBlock, ChartSvg).
 * Colour order validated with the dataviz palette checker (light on #ffffff, dark on #15181c):
 * blue, orange, aqua, yellow. Text uses ink colours, never the series colour.
 */
.osh-chart {
    --oc-surface: #ffffff; --oc-ink: #0b0b0b; --oc-ink2: #52514e; --oc-muted: #898781;
    --oc-grid: #e1e0d9; --oc-base: #c3c2b7;
    --oc-1: #2a78d6; --oc-2: #eb6834; --oc-3: #1baf7a; --oc-4: #eda100; --oc-o: #b4b2ac;
    margin: 0 0 1.75em; color: var(--oc-ink);
}
:root[data-theme="dark"] .osh-chart, .dark .osh-chart {
    --oc-surface: #15181c; --oc-ink: #f0efec; --oc-ink2: #c3c2b7; --oc-muted: #898781;
    --oc-grid: #2c2c2a; --oc-base: #383835;
    --oc-1: #3987e5; --oc-2: #d95926; --oc-3: #199e70; --oc-4: #c98500; --oc-o: #5a5a56;
}
.osh-chart .osh-s1 { --oc: var(--oc-1); } .osh-chart .osh-s2 { --oc: var(--oc-2); }
.osh-chart .osh-s3 { --oc: var(--oc-3); } .osh-chart .osh-s4 { --oc: var(--oc-4); } .osh-chart .osh-so { --oc: var(--oc-o); }

.osh-chart-head { display: flex; flex-direction: column; gap: 2px; margin: 0 0 .7em; }
.osh-chart-title { font-weight: 650; font-size: 1.02em; color: var(--oc-ink); }
.osh-chart-sub { font-size: .86em; color: var(--oc-ink2); }
.osh-chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 .6em; padding: 0; list-style: none; font-size: .86em; color: var(--oc-ink2); }
.osh-chart-legend li { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 0; }
.osh-chart-legend li::before, .osh-chart-legend li::marker { content: none !important; }
.osh-chart-key { display: inline-block; flex: none; background: var(--oc); }
.osh-chart-key.is-box { width: 10px; height: 10px; border-radius: 3px; }
.osh-chart-key.is-line { width: 16px; height: 2px; border-radius: 2px; }
.osh-chart-legend.is-list { flex-direction: column; gap: 7px; font-size: .92em; }
.osh-chart-legend.is-list li { display: grid; grid-template-columns: 12px 1fr auto 3.2em; gap: 9px; color: var(--oc-ink2); }
.osh-chart-legend.is-list.is-pct li { grid-template-columns: 12px 1fr auto; }
.osh-chart-legend.is-list b { font-weight: 600; color: var(--oc-ink); font-variant-numeric: tabular-nums; }
.osh-chart-legend.is-list em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }

.osh-chart-plot svg, .osh-chart-donut svg { display: block; width: 100%; height: auto; overflow: visible; }
.osh-chart-plot.is-narrow { display: none; }
@media (max-width: 560px) { .osh-chart-plot.is-wide { display: none; } .osh-chart-plot.is-narrow { display: block; } }
.osh-chart-donut { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.osh-chart-donut svg { width: 220px; max-width: 60%; }
.osh-chart-donut .osh-chart-legend { flex: 1 1 220px; margin: 0; }

.osh-c-svg text { font-family: inherit; font-size: 13px; fill: var(--oc-ink2); }
.osh-c-svg .osh-c-tick { fill: var(--oc-muted); font-variant-numeric: tabular-nums; }
.osh-c-svg .osh-c-value { fill: var(--oc-ink2); font-weight: 600; font-variant-numeric: tabular-nums; }
.osh-c-grid { stroke: var(--oc-grid); stroke-width: 1; shape-rendering: crispEdges; }
.osh-c-base { stroke: var(--oc-base); stroke-width: 1; shape-rendering: crispEdges; }
.osh-c-bar, .osh-c-slice { fill: var(--oc); }
.osh-c-slice { stroke: var(--oc-surface); stroke-width: 2; }
.osh-c-line { fill: none; stroke: var(--oc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.osh-c-dot, .osh-c-hdot { fill: var(--oc); stroke: var(--oc-surface); stroke-width: 2; }
.osh-c-hitarea { fill: transparent; }
.osh-c-hit { cursor: default; outline: none; }
.osh-c-hit .osh-c-cross, .osh-c-hit .osh-c-hdot { opacity: 0; transition: opacity .1s; }
.osh-c-cross { stroke: var(--oc-base); stroke-width: 1; }
.osh-c-hit:hover .osh-c-cross, .osh-c-hit:focus-visible .osh-c-cross, .osh-c-hit:hover .osh-c-hdot, .osh-c-hit:focus-visible .osh-c-hdot { opacity: 1; }
.osh-c-hit:hover .osh-c-bar, .osh-c-hit:focus-visible .osh-c-bar, .osh-c-hit:hover .osh-c-slice, .osh-c-hit:focus-visible .osh-c-slice { filter: brightness(1.12); }
.osh-c-hit:focus-visible .osh-c-hitarea { stroke: var(--oc-ink2); stroke-width: 1; }

.osh-chart-source { margin: .5em 0 0; font-size: .82em; color: var(--oc-muted); }
.osh-chart-table { margin-top: .5em; font-size: .88em; }
.osh-chart-table summary { cursor: pointer; color: var(--oc-ink2); width: fit-content; }
.osh-chart-scroll { overflow-x: auto; margin-top: .5em; }
.osh-chart-table table { width: auto; min-width: 50%; }
.osh-chart-table td:not(:first-child), .osh-chart-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.osh-chart-tip { position: fixed; z-index: 90; min-width: 120px; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: #ffffff; color: #0b0b0b; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .25), 0 0 0 1px rgba(11, 11, 11, .1); font: 13px/1.4 Inter, system-ui, sans-serif; pointer-events: none; }
:root[data-theme="dark"] .osh-chart-tip, .dark .osh-chart-tip { background: #22262b; color: #f0efec; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1); }
.osh-chart-tip[hidden] { display: none; }
.osh-chart-tip-t { margin-bottom: 4px; color: #52514e; font-size: 12px; }
:root[data-theme="dark"] .osh-chart-tip-t, .dark .osh-chart-tip-t { color: #c3c2b7; }
.osh-chart-tip-r { display: grid; grid-template-columns: 12px auto 1fr; align-items: center; gap: 7px; }
.osh-chart-tip-r i { width: 12px; height: 2px; border-radius: 2px; background: var(--oc); }
.osh-chart-tip-r b { font-weight: 650; font-variant-numeric: tabular-nums; }
.osh-chart-tip-r span { color: #52514e; }
:root[data-theme="dark"] .osh-chart-tip-r span, .dark .osh-chart-tip-r span { color: #c3c2b7; }
