/* Charts shared by the landing page and the app: a zero baseline, labelled axes, gridlines and tooltips.
   Billed and collected use two hues checked with the data-viz palette validator. Planned values are a grey reference. */
.xc { --xc-bar: #b02a5b; --xc-bar-hi: #8e1f48; --xc-second: #c27800; --xc-plan: #7d8a97; --xc-grid: #ece6e8; --xc-base: #bfb0b7; --xc-ink: #271a21; --xc-ink2: #625159; --xc-hover: rgba(176, 42, 91, .07); --xc-tip: #2e1322; --xc-tip-ink: #fff; --xc-label: minmax(90px, 150px); --xc-value: 56px; --xc-h: 220px; color: var(--xc-ink); }
.xc ul, .xc ol { margin: 0; padding: 0; list-style: none; }
.xc p { margin: 0; }
.xc-tip { position: absolute; z-index: 5; width: max-content; max-width: 220px; padding: 7px 11px; border-radius: 9px; background: var(--xc-tip); color: var(--xc-tip-ink); font-size: 13px; font-style: normal; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55); display: none; pointer-events: none; }
.xc-axisname { margin-top: 2px; font-size: 13px; color: var(--xc-ink2); text-align: center; }
.xc-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px !important; font-size: 13px; color: var(--xc-ink2); }
.xc-legend span { display: inline-flex; align-items: center; gap: 7px; }
.xc-legend i { width: 14px; height: 10px; border-radius: 3px; background: var(--xc-bar); }
.xc-legend i.k-second { background: var(--xc-second); }
.xc-legend i.k-plan { height: 3px; background: var(--xc-plan); }
.xc-legend i.k-mark { width: 3px; height: 14px; border-radius: 2px; background: var(--xc-ink); }

/* Horizontal bars */
.xc-row { position: relative; display: grid; grid-template-columns: var(--xc-label) minmax(0, 1fr) var(--xc-value); column-gap: 12px; align-items: stretch; width: 100%; min-height: 40px; color: inherit; text-decoration: none; border-radius: 6px; }
a.xc-row:hover, .xc-row[tabindex]:hover { background: var(--xc-hover); }
.xc-label { align-self: center; min-width: 0; font-size: 13.5px; line-height: 1.25; text-align: left; }
.xc-area { position: relative; background: linear-gradient(90deg, var(--xc-grid) 1px, transparent 1px) 0 0 / calc(100% / var(--xc-div)) 100%; box-shadow: inset -1px 0 0 var(--xc-grid); border-left: 1px solid var(--xc-base); }
.xc-area i { position: absolute; left: 0; top: 50%; height: 14px; margin-top: -7px; width: calc(var(--v) * 100%); border-radius: 0 4px 4px 0; background: var(--xc-bar); }
.xc-row:hover .xc-area i, .xc-row:focus-visible .xc-area i { filter: brightness(.88); }
.xc-val { align-self: center; font-size: 13px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xc-row .xc-tip { right: 0; bottom: calc(100% - 6px); }
li:first-child > .xc-row .xc-tip { bottom: auto; top: calc(100% - 6px); }
.xc-row:hover .xc-tip, .xc-row:focus-visible .xc-tip { display: block; }
.xc-xaxis { display: grid; grid-template-columns: var(--xc-label) minmax(0, 1fr) var(--xc-value); column-gap: 12px; height: 24px; }
.xc-ticks { grid-column: 2; position: relative; border-top: 1px solid var(--xc-base); }
.xc-ticks b { position: absolute; top: 4px; transform: translateX(-50%); font-size: 13px; font-weight: 500; color: var(--xc-ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.xc-ticks b:first-child { transform: none; }
.xc-ticks b:last-child { transform: translateX(-100%); }

/* Progress against plan: the bar is completed work, the dark tick is the plan for today */
.xc-plan { --xc-value: 44px; }
.xc-plan .xc-row { min-height: 44px; }
.xc-area b { position: absolute; top: 50%; width: 3px; height: 24px; margin: -12px 0 0 -1.5px; border-radius: 2px; background: var(--xc-ink); box-shadow: 0 0 0 1.5px #fff; }

/* Billed and collected pairs */
.xc-pair { --xc-label: 34px; --xc-value: 0px; }
.xc-pair .xc-row { grid-template-columns: var(--xc-label) minmax(0, 1fr); min-height: 44px; }
.xc-pair-set { display: grid; gap: 2px; align-content: center; }
.xc-pair-bar { display: grid; grid-template-columns: minmax(0, 1fr) 54px; column-gap: 8px; height: 17px; }
.xc-pair-bar .xc-area i { height: 13px; margin-top: -6.5px; }
.xc-area i.k-paid, .xc-area i.k-second { background: var(--xc-second); }
.xc-pair-bar .xc-val { font-weight: 600; line-height: 17px; }
.xc-pair .xc-xaxis { grid-template-columns: var(--xc-label) minmax(0, 1fr) 54px; column-gap: 8px; }
.xc-pair .xc-xaxis { column-gap: 8px; }

/* Progress over time: step lines */
.xc-l .xc-frame { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; padding: 18px 8px 0 0; }
.xc-yaxis, .xc-plot { position: relative; height: var(--xc-h); }
.xc-yaxis b { position: absolute; right: 0; transform: translateY(50%); font-size: 13px; font-weight: 500; color: var(--xc-ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.xc-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--xc-grid); }
.xc-line.is-base { background: var(--xc-base); }
.xc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.xc-plot path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.xc-plot .p-plan { stroke: var(--xc-plan); }
.xc-plot .p-actual { stroke: var(--xc-bar); stroke-width: 3; }
.xc-end { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--xc-bar); box-shadow: 0 0 0 2px #fff; }
.xc-now { position: absolute; top: -4px; bottom: 0; width: 1px; background: var(--xc-ink2); opacity: .8; }
.xc-now b { position: absolute; bottom: 100%; left: 0; transform: translateX(-50%); font-size: 13px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.xc-now.is-end b { transform: translateX(-85%); }
.xc .xc-hits { position: absolute; inset: 0; }
.xc-hits li { position: absolute; top: 0; bottom: 0; }
.xc-hits li:focus-visible { outline: 2px solid var(--xc-bar); outline-offset: -2px; }
.xc-hits em { position: absolute; top: 0; bottom: 0; width: 1px; font-style: normal; }
.xc-hits em > i { position: absolute; width: 9px; height: 9px; margin: 0 0 -4.5px -4.5px; border-radius: 50%; background: var(--xc-bar); box-shadow: 0 0 0 2px #fff; display: none; }
.xc-hits em > i.is-plan { background: var(--xc-plan); }
.xc-hits .xc-tip { top: 8px; left: 0; transform: translateX(-50%); width: max-content; max-width: 170px; }
.xc-hits .tip-start .xc-tip { left: 0; transform: none; }
.xc-hits .tip-end .xc-tip { left: auto; right: 0; transform: none; }
.xc-hits li:hover em, .xc-hits li:focus-visible em { background: var(--xc-base); }
.xc-hits li:hover :is(.xc-tip, em > i), .xc-hits li:focus-visible :is(.xc-tip, em > i) { display: block; }
.xc-dates { grid-column: 2; position: relative; height: 24px; margin-top: 6px; }
.xc-dates span { position: absolute; transform: translateX(-50%); font-size: 13px; color: var(--xc-ink2); white-space: nowrap; }
.xc-dates span:first-child { transform: none; }
.xc-dates span:last-child { transform: translateX(-100%); }

@media (max-width: 760px) {
  .xc-h:not(.xc-pair) .xc-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "area area"; row-gap: 5px; min-height: 0; padding-block: 8px; }
  .xc-h:not(.xc-pair) .xc-label { grid-area: label; font-size: 14px; }
  .xc-h:not(.xc-pair) .xc-val { grid-area: value; font-size: 14px; }
  .xc-h:not(.xc-pair) .xc-area { grid-area: area; height: 18px; }
  .xc-h:not(.xc-pair) .xc-xaxis { grid-template-columns: minmax(0, 1fr); }
  .xc-h:not(.xc-pair) .xc-xaxis > span:first-child { display: none; }
  .xc-h:not(.xc-pair) .xc-ticks { grid-column: 1; }
}
