/* ONE CHART SYSTEM (job 50, crates/af-chart). Every chart has its area: a grid, a value axis with short numbers, the
   labels along the bottom, "No data for this time" in the middle when it is empty. Colours come from the page's own
   variables (--accent, --muted, --txt, --amber), so each app keeps its look. rem only. */
.axc {
  --axc-ink: var(--accent, #28e4d2);
  --axc-axis: var(--muted, #8da5b2);
  --axc-text: var(--txt, inherit);
  --axc-grid: color-mix(in srgb, var(--axc-axis) 24%, transparent);
  --axc-base: color-mix(in srgb, var(--axc-axis) 55%, transparent);
  --axc-cell: color-mix(in srgb, var(--axc-axis) 14%, transparent);
  --axc-heat: var(--axc-ink);
  --axc-markc: var(--amber, #f1c65b);
  margin: 0;
  min-width: 0;
  font-size: var(--fs-xs, .72rem);
  line-height: 1.2;
  color: var(--axc-axis);
  font-variant-numeric: tabular-nums;
}
.axc a { color: inherit; }

/* bars and lines: the value axis | the plot | the right axis, the labels under the plot */
/* the top label sits half above the plot: room for it, so a chart under another never runs into its legend */
.axc-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: var(--axc-h, 10rem) auto; column-gap: .45rem; padding-top: .45rem; }
.axc-short .axc-wrap { --axc-h: 6rem; }
.axc-tall .axc-wrap { --axc-h: 15rem; }
.axc-y { position: relative; grid-row: 1; min-width: 2rem; }
.axc-y-r { grid-column: 3; }
.axc-y-r:empty { min-width: 0; }
.axc-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; line-height: 1; }
.axc-y-r span { right: auto; left: 0; }
.axc-plot { position: relative; grid-row: 1; grid-column: 2; border-left: 1px solid var(--axc-base); border-bottom: 1px solid var(--axc-base); }
.axc-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--axc-grid); pointer-events: none; }
/* the richer look (job 142, sysops): a vertical line under each written label, as faint as the horizontal ones */
.axc-vgrid { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--axc-grid); pointer-events: none; }
.axc-x { position: relative; grid-row: 2; grid-column: 2; height: 1.1rem; margin-top: .3rem; }
.axc-x span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; line-height: 1; }
.axc-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--axc-axis); font-size: var(--fs-xs, .8rem); pointer-events: none; }

.axc-cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; padding: 0 1px; }
.axc-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column-reverse; }
.axc-col i { display: block; flex: none; min-height: 0; }
.axc-col i:last-child { border-radius: 2px 2px 0 0; }
.axc-col.axc-side { flex-direction: row; align-items: flex-end; gap: 1px; }
/* a column's total written above it (bars.values): the last child of the column sits at its top */
.axc-v { display: block; flex: none; padding-bottom: .15rem; text-align: center; white-space: nowrap; font-size: var(--fs-xs, .68rem); line-height: 1.1; color: var(--axc-text); }
/* sixteen columns or more are too narrow for their numbers (a month of days): the tooltip says each */
.axc-cols:has(> :nth-child(16)) .axc-v { display: none; }
.axc-side i { flex: 1 1 0; border-radius: 2px 2px 0 0; }
.axc-col:hover { background: color-mix(in srgb, var(--axc-axis) 12%, transparent); }
/* the richer look (job 142): the point's words as a list in its column, shown on hover: the time, then a line a
   series with its swatch, as the legend; near the plot's edges it hangs from that edge */
.axc-col { position: relative; }
.axc-tip { display: none; position: absolute; top: .3rem; left: 50%; transform: translateX(-50%); z-index: 5; min-width: 8rem; max-width: 18rem; padding: .4rem .55rem; border-radius: .4rem; border: 1px solid var(--axc-base); background: var(--axc-tipbg, color-mix(in srgb, var(--bg, #0b1620) 92%, var(--axc-axis))); color: var(--axc-text); box-shadow: 0 .3rem 1rem rgba(0, 0, 0, .35); font-size: var(--fs-xs, .72rem); line-height: 1.35; text-align: left; white-space: nowrap; pointer-events: none; }
.axc-col:hover .axc-tip { display: block; }
.axc-tip b { display: block; margin-bottom: .25rem; color: var(--axc-text); font-weight: 600; }
.axc-tip ul { margin: 0; padding: 0; list-style: none; }
.axc-tip li { display: flex; align-items: center; gap: .35rem; color: var(--axc-text); }
.axc-tip li span { margin-left: auto; padding-left: .8rem; }
.axc-tip-l { left: 0; transform: none; }
.axc-tip-r { left: auto; right: 0; transform: none; }
/* many columns: thinner gaps, then none, so a bar keeps its width (365 days); the hover columns never need gaps */
.axc-cols:has(> :nth-child(61)) { gap: 1px; }
.axc-cols:has(> :nth-child(121)), .axc-hits { gap: 0; padding: 0; }

.axc-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.axc-svg polyline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* a dot series (errors over a machine's measures): a zero-length stroke with round caps, 6 px across */
.axc-svg .axc-dot { stroke-width: 6; }
.axc-svg .axc-area { opacity: .16; stroke: none; }

.axc-mark { position: absolute; top: 0; bottom: 0; width: .45rem; transform: translateX(-50%); background: linear-gradient(to right, transparent calc(50% - 1px), var(--axc-markc) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); }
.axc-mark.launch { --axc-markc: var(--axc-axis); opacity: .7; }
.axc-mark.future { --axc-markc: var(--violet, #a78bfa); }
.axc-mark.bad { --axc-markc: var(--red, #ff5d5d); }
.axc-mark.ok { --axc-markc: var(--green, #3ddc97); }

.axc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; margin-top: .45rem; font-size: var(--fs-xs, .72rem); color: var(--axc-axis); }
.axc-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.axc-legend b { color: var(--axc-text); font-weight: 600; }
/* the legend over the chart (jose's machine-page mockups): round swatches, a note at its right end (the axis's name) */
.axc-legend-top { margin: 0 0 .35rem; }
.axc-legend-top .axc-sw { border-radius: 50%; }
.axc-lnote { margin-left: auto; color: var(--axc-axis); }
/* a legend entry for the marks: a short red line, as on the chart */
.axc-sw-mark { width: 2px; height: .8rem; border-radius: 0; background: var(--red, #ff5d5d); }
.axc-sw { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; flex: none; }

/* a ranked list: label | bar along the axis | value */
.axc-hrows { display: grid; grid-template-columns: fit-content(40%) minmax(5rem, 1fr) auto; column-gap: .6rem; }
.axc-hrow { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; }
.axc-hrow:not(.axc-haxis):not(.axc-hnone):hover { background: color-mix(in srgb, var(--axc-axis) 10%, transparent); }
.axc-hlabel { min-width: 0; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--axc-text); font-size: var(--fs-xs, .78rem); }
/* the grid lines at the axis's own steps: the figure says how far apart they are (--axc-hstep) */
.axc-htrack { position: relative; display: flex; align-items: center; height: 1.45rem; background: repeating-linear-gradient(to right, var(--axc-grid) 0 1px, transparent 1px var(--axc-hstep, 25%)); box-shadow: inset -1px 0 var(--axc-grid), inset 1px 0 var(--axc-base); }
.axc-htrack i { display: block; height: .8rem; flex: none; }
.axc-htrack i:last-child { border-radius: 0 2px 2px 0; }
.axc-hval { text-align: right; white-space: nowrap; color: var(--axc-text); font-size: var(--fs-xs, .78rem); }
.axc-hval small { color: var(--axc-axis); font-size: var(--fs-xs, .7rem); }
.axc-hnone .axc-htrack { height: 4.5rem; }
.axc-hx { position: relative; height: 1.2rem; border-top: 1px solid var(--axc-base); }
.axc-hx span { position: absolute; top: .25rem; transform: translateX(-50%); white-space: nowrap; line-height: 1; }

/* a spark: a little bar chart for a table cell, its scale's top above it */
.axc-spark { display: inline-grid; grid-template-rows: auto 1.6rem; width: 7.5rem; vertical-align: middle; font-size: var(--fs-xs, .6rem); line-height: 1; color: var(--axc-axis, var(--muted, #8da5b2)); }
.axc-stop { padding-bottom: .1rem; }
.axc-scols { position: relative; display: flex; align-items: flex-end; gap: 1px; border-top: 1px dashed color-mix(in srgb, var(--muted, #8da5b2) 30%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--muted, #8da5b2) 55%, transparent); }
.axc-scols i { flex: 1 1 0; min-width: 1px; border-radius: 1px 1px 0 0; }
.axc-scols i.axc-zero { height: 1px !important; opacity: .35; }
.axc-scols .axc-empty { font-size: var(--fs-xs, .6rem); white-space: nowrap; }
.axc-spark { --axc-ink: var(--accent, #28e4d2); }

/* a donut: the total in the middle, the legend beside it */
.axc-donut { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.2rem; }
.axc-ring { position: relative; flex: none; width: var(--axc-d, 8rem); height: var(--axc-d, 8rem); }
.axc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.axc-ring circle { fill: none; stroke-width: 5; }
.axc-ring .axc-ring-bg { stroke: var(--axc-cell); }
.axc-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; text-align: center; }
.axc-mid b { font-size: var(--fs-md, 1.15rem); color: var(--axc-text); }
.axc-mid small { max-width: 58%; font-size: var(--fs-xs, .62rem); line-height: 1.15; color: var(--axc-axis); }
.axc-dlegend { flex-direction: column; align-items: flex-start; gap: .3rem; margin: 0; }

/* a heatmap: labels, cells by strength, the columns along the bottom, a scale */
.axc-hbody { position: relative; }
.axc-hgrid { display: grid; gap: 2px; align-items: center; }
.axc-hgrid i { display: block; height: var(--axc-cellh, .95rem); border-radius: 2px; background: color-mix(in srgb, var(--axc-heat) calc(var(--v, 0) * 1%), var(--axc-cell)); }
.axc-hgrid i.axc-gap { background: none; }
.axc-rl { padding-right: .45rem; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--axc-text); font-size: var(--fs-xs, .72rem); }
.axc-cl { justify-self: center; width: 0; display: flex; justify-content: center; white-space: nowrap; font-size: var(--fs-xs, .66rem); padding-top: .2rem; }
.axc-hempty { position: relative; height: 5rem; background: var(--axc-cell); border-radius: 3px; }
.axc-scale { display: inline-flex; align-items: center; gap: .35rem; }
.axc-scale i { display: inline-block; width: 5rem; height: .55rem; border-radius: 2px; background: linear-gradient(to right, var(--axc-cell), var(--axc-heat)); }

/* moving (job 184, jose 2026-11-10: "it needs to look super awesome and animated"): inside an .axc-anim box a chart
   draws in once, lines from left to right, bars from their base, ranked bars from the left, then its legend. A dashed
   line (a comparison) and its swatch. Nothing moves for a reader who asked for less motion. */
@keyframes axc-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes axc-up { from { transform: scaleY(0); } }
@keyframes axc-across { from { transform: scaleX(0); } }
@keyframes axc-fade { from { opacity: 0; } }
.axc-anim .axc-svg { animation: axc-reveal 1.6s cubic-bezier(.22, .8, .3, 1) both; }
.axc-anim .axc-col i { transform-origin: bottom; animation: axc-up .9s cubic-bezier(.22, .8, .3, 1) both; }
.axc-anim .axc-htrack i { transform-origin: left; animation: axc-across .9s cubic-bezier(.22, .8, .3, 1) both; }
.axc-anim .axc-legend { animation: axc-fade .6s .8s both; }
.axc-svg polyline.axc-dash { stroke-dasharray: 7 6; }
/* a dashed line's swatch: a short dashed line, as on the chart (job 184.1: a square with a faint pattern read as the
   colour before it) */
.axc-sw-dash { width: 1.1rem; height: .22rem; border-radius: 0; -webkit-mask: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 7px); mask: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 7px); }
/* a strong line (the comparison model), thicker and over the others */
.axc-svg polyline.axc-strong { stroke-width: 4; }
/* each line's name at its end, right of the plot (Lines::end_names): the right column makes room for them */
.axc-wrap:has(.axc-end) .axc-y-r { min-width: 7.5rem; }
.axc-end { position: absolute; left: 100%; margin-left: .45rem; transform: translateY(50%); max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; color: var(--axc-text); pointer-events: none; }
.axc-end i { display: inline-block; width: .5rem; height: 2px; margin-right: .25rem; vertical-align: middle; }
.axc-anim .axc-end { animation: axc-fade .6s 1.2s both; }

/* the race: a bar an item, moving to its place each period; the period large at the bottom right */
.axc-race-body { position: relative; overflow: hidden; }
.axc-race-row { position: absolute; top: 0; left: 0; right: 0; height: 1.8rem; display: grid; grid-template-columns: minmax(5.5rem, 11rem) minmax(0, 1fr) 4.2rem; align-items: center; gap: .6rem; transition: transform .7s cubic-bezier(.22, .8, .3, 1), opacity .4s; }
.axc-race-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: var(--axc-text); font-size: var(--fs-sm, .82rem); }
.axc-race-track { height: 1.3rem; }
.axc-race-track i { display: block; width: 0; height: 100%; border-radius: 0 4px 4px 0; transition: width .7s cubic-bezier(.22, .8, .3, 1); }
.axc-race-val { color: var(--axc-text); font-size: var(--fs-sm, .82rem); }
.axc-race-period { position: absolute; right: 4.8rem; bottom: .1rem; font-size: clamp(1.6rem, 5vw, 3.2rem); font-weight: 700; color: color-mix(in srgb, var(--axc-axis) 45%, transparent); pointer-events: none; }
.axc-race-ctl { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }
.axc-race-ctl input { flex: 1; min-width: 0; accent-color: var(--axc-ink); }
.axc-race-track i.axc-race-dash { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .5) 5px 9px); }
.axc-race-floor { white-space: nowrap; color: var(--axc-axis); }
.axc-race-play { font: inherit; font-size: var(--fs-sm, .82rem); color: var(--axc-text); background: var(--axc-cell); border: 1px solid var(--axc-base); border-radius: .4rem; padding: .35rem .9rem; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .axc-anim .axc-svg, .axc-anim .axc-col i, .axc-anim .axc-htrack i, .axc-anim .axc-legend, .axc-anim .axc-end { animation: none; }
  .axc-race-row, .axc-race-track i { transition: none; }
}
