/* Charts shared by the landing page and the app: one hue, a zero baseline, labelled axes, gridlines and tooltips.
   Colours can be changed per surface with the --xc-* variables. */
.xc { --xc-bar: #9a5b0a; --xc-bar-hi: #774505; --xc-b2: #2472b2; --xc-b2-hi: #1b5788; --xc-grid: #e6e6e2; --xc-base: #aeaea6; --xc-ink: #202124; --xc-ink2: #55585e; --xc-hover: rgba(154, 91, 10, .07); --xc-tip: #24262a; --xc-tip-ink: #fff; --xc-label: minmax(84px, 132px); --xc-value: 64px; 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; padding: 7px 11px; border-radius: 9px; background: var(--xc-tip); color: var(--xc-tip-ink); font-size: 12.5px; font-weight: 500; line-height: 1.4; text-align: left; white-space: nowrap; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55); display: none; pointer-events: none; }
.xc-axisname { margin-top: 4px; font-size: 12px; color: var(--xc-ink2); text-align: center; }

/* 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-row:focus-visible { outline: 2px solid var(--xc-bar); outline-offset: 1px; }
.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: 13.5px; font-weight: 600; 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: 5px; transform: translateX(-50%); font-size: 11.5px; font-weight: 500; color: var(--xc-ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Columns */
.xc-frame { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 8px; padding-top: 18px; }
.xc-yaxis, .xc-plot { position: relative; height: var(--xc-h, 210px); }
.xc-yaxis b { position: absolute; right: 0; transform: translateY(50%); font-size: 11.5px; 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 .xc-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--xc-n), minmax(0, 1fr)); }
.xc-cols li { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; border-radius: 6px 6px 0 0; }
.xc-cols li:hover, .xc-cols li:focus-visible { background: var(--xc-hover); }
.xc-cols li:focus-visible { outline: 2px solid var(--xc-bar); }
.xc-colbar { position: relative; width: min(46px, 66%); height: calc(var(--v) * 100%); border-radius: 4px 4px 0 0; background: var(--xc-bar); }
.xc-colbar em { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font-size: 12px; font-style: normal; font-weight: 600; white-space: nowrap; }
.xc-cols li:hover .xc-colbar, .xc-cols li:focus-visible .xc-colbar { background: var(--xc-bar-hi); }
.xc-cols .xc-tip { left: 50%; transform: translateX(-50%); bottom: min(calc(var(--v) * 100% + 28px), calc(100% - 40px)); }
.xc-cols li:first-child .xc-tip { left: 0; transform: none; }
.xc-cols li:last-child .xc-tip { left: auto; right: 0; transform: none; }
.xc-cols li:hover .xc-tip, .xc-cols li:focus-visible .xc-tip { display: block; }
.xc-xlabels { grid-column: 2; display: grid; grid-template-columns: repeat(var(--xc-n), minmax(0, 1fr)); padding-top: 7px; }
.xc-xlabels span { font-size: 12px; text-align: center; color: var(--xc-ink2); }

/* Two series: legend above, columns in pairs */
.xc .xc-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--xc-ink2); }
.xc-legend li { display: flex; align-items: center; gap: 7px; }
.xc-legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--xc-bar); }
.xc-legend i.s1 { background: var(--xc-b2); }
.xc-legend i.is-dash { width: 18px; height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--xc-ink2); }
.xc-v .xc-cols li { gap: 2px; }
.xc-v .xc-colbar { width: min(24px, 38%); }
.xc-v .xc-colbar.s1 { background: var(--xc-b2); }
.xc-v .xc-cols li:hover .xc-colbar.s1, .xc-v .xc-cols li:focus-visible .xc-colbar.s1 { background: var(--xc-b2-hi); }
.xc-v .xc-colbar em { font-size: 11.5px; font-weight: 600; }

/* Step line: stock level over time */
.xc-s .xc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.xc-fill { fill: var(--xc-bar); opacity: .09; }
.xc-stroke { fill: none; stroke: var(--xc-bar); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.xc-mark { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--xc-ink2); opacity: .75; }
.xc .xc-hits { position: absolute; inset: 0; display: flex; }
.xc-hits li { position: relative; flex: 1; min-width: 0; outline: none; }
.xc-hits li:hover, .xc-hits li:focus-visible { background: rgba(32, 33, 36, .08); }
.xc-hits li > i { position: absolute; left: 50%; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 99px; background: var(--xc-bar); box-shadow: 0 0 0 2px #fff; display: none; }
.xc-hits li:hover > i, .xc-hits li:focus-visible > i { display: block; }
.xc-hits .xc-tip { top: -14px; left: 50%; transform: translateX(-50%); }
.xc-hits li.is-left .xc-tip { left: 0; transform: none; }
.xc-hits li.is-right .xc-tip { left: auto; right: 0; transform: none; }
.xc-hits li:hover .xc-tip, .xc-hits li:focus-visible .xc-tip { display: block; }
.xc-xticks { grid-column: 2; position: relative; height: 26px; }
.xc-xticks b { position: absolute; top: 7px; transform: translateX(-50%); font-size: 12px; font-weight: 500; color: var(--xc-ink2); white-space: nowrap; }
.xc-xticks b:last-child { transform: translateX(-90%); }

@media (max-width: 639px) {
  .xc { --xc-label: 92px; --xc-value: 54px; }
  .xc-row, .xc-xaxis { column-gap: 8px; }
  .xc-label { font-size: 14px; }
  .xc-colbar em { font-size: 12px; }
  .xc-axisname { font-size: 13px; }
  .xc-xlabels span { width: min-content; justify-self: center; font-size: 13px; line-height: 1.25; }
  .xc-yaxis b { font-size: 12px; }
  .xc-frame { grid-template-columns: 38px minmax(0, 1fr); column-gap: 6px; }
  .xc-h .xc-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "area area"; row-gap: 6px; min-height: 0; padding-block: 8px; align-content: center; }
  .xc-h .xc-label { grid-area: label; }
  .xc-h .xc-val { grid-area: value; font-size: 14px; }
  .xc-h .xc-area { grid-area: area; height: 16px; border-radius: 0 4px 4px 0; }
  .xc-h .xc-xaxis { grid-template-columns: minmax(0, 1fr); }
  .xc-h .xc-xaxis > span:first-child { display: none; }
  .xc-h .xc-ticks { grid-column: 1; }
  .xc-ticks b { font-size: 12px; }
  .xc-ticks b:first-child { transform: none; }
  .xc-ticks b:last-child { transform: translateX(-100%); }
  .xc-cols .xc-tip { white-space: normal; width: max-content; max-width: 150px; }
  .xc-hits .xc-tip { white-space: normal; width: max-content; max-width: 190px; }
  .xc-v .xc-colbar em { display: none; }
  .xc-v.is-few .xc-colbar em { display: block; }
  .xc-cols li:nth-child(-n+3) .xc-tip { left: 0; right: auto; transform: none; }
  .xc-cols li:nth-last-child(-n+3) .xc-tip { left: auto; right: 0; transform: none; }
}

/* Tallyview additions */
.xc { --xc-bar: #34424e; --xc-bar-hi: #1c262e; --xc-b2: #c68a3e; --xc-b2-hi: #a56f28; --xc-grid: #ece7dd; --xc-base: #a9a091; --xc-ink: #1e2328; --xc-ink2: #5a564e; --xc-hover: rgba(52, 66, 78, .07); --xc-tip: #1e262d; --xc-label: minmax(84px, 128px); --xc-value: 56px; }
.xc-tip b, .xc-tip span { display: block; }
.xc-tip b { font-weight: 700; }
.xc .xc-legend { margin: 0 0 2px; }
.xc-legend i.k-main { width: 16px; height: 3px; background: var(--xc-bar); }
.xc-legend i.k-prev { width: 18px; height: 0; border-radius: 0; background: none; border-top: 2px dashed #948b7c; }
.xc-legend i.k-target { width: 18px; height: 0; border-radius: 0; background: none; border-top: 3px dotted #b9772b; }
.xc-legend i.k-bar { background: var(--xc-bar); }
.xc-legend i.k-bar2 { background: var(--xc-b2); }
.xc-legend i.k-mark { width: 3px; height: 15px; border-radius: 1px; background: #b9772b; }
.xc-frame { padding-top: 22px; }
.xc-yaxis, .xc-plot { height: var(--xc-h, 220px); }
.chart-card .xc-t, .chart-card .xc-v, .chart-card .xc-s { display: flex; flex: 1; flex-direction: column; }
.chart-card .xc-t .xc-frame, .chart-card .xc-v .xc-frame, .chart-card .xc-s .xc-frame { flex: 1; grid-template-rows: minmax(var(--xc-h, 220px), 1fr) auto; }
.chart-card :is(.xc-t, .xc-v, .xc-s) :is(.xc-yaxis, .xc-plot) { height: auto; }
.xc-frame { grid-template-columns: 48px minmax(0, 1fr); }

/* Trend lines */
.xc-t .xc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.xc path { vector-effect: non-scaling-stroke; }
.t-area { fill: var(--xc-bar); opacity: .08; stroke: none; }
.t-main { fill: none; stroke: var(--xc-bar); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.t-prev { fill: none; stroke: #948b7c; stroke-width: 1.75; stroke-dasharray: 6 5; }
.t-target { fill: none; stroke: #b9772b; stroke-width: 2.5; stroke-dasharray: 1 6; stroke-linecap: round; }
.xc .t-hits { position: absolute; inset: 0; display: flex; }
.t-hits > li { position: relative; flex: 1; min-width: 0; }
.t-hits > li > :is(a, div) { position: absolute; inset: 0; display: block; border-radius: 6px; color: inherit; }
.t-hits > li > :is(a, div):hover, .t-hits > li > :is(a, div):focus-visible { background: var(--xc-hover); }
.t-dot { position: absolute; left: 50%; width: 9px; height: 9px; margin: 0 0 -4.5px -4.5px; border: 2px solid var(--xc-bar); border-radius: 99px; background: #fffdf9; }
.t-hits > li > :hover .t-dot, .t-hits > li > :focus-visible .t-dot { background: var(--xc-bar); }
.t-val { position: absolute; left: 50%; margin-bottom: 8px; padding: 0 3px; transform: translateX(-50%); border-radius: 4px; background: rgba(255, 253, 249, .88); font-size: 11.5px; font-style: normal; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.t-hits .xc-tip { top: -16px; left: 50%; transform: translateX(-50%); }
.t-hits .is-left .xc-tip { left: 0; transform: none; }
.t-hits .is-right .xc-tip { left: auto; right: 0; transform: none; }
.t-hits > li > :hover .xc-tip, .t-hits > li > :focus-visible .xc-tip { display: block; }
.t-x { grid-column: 2; }

/* Columns as links */
.xc-cols li > :is(a, div) { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-radius: 6px 6px 0 0; color: inherit; }
.xc-cols li > :is(a, div):hover, .xc-cols li > :is(a, div):focus-visible { background: var(--xc-hover); }
.xc-cols li > a:hover .xc-colbar, .xc-cols li > a:focus-visible .xc-colbar { filter: brightness(.86); }
.xc-cols li > :hover .xc-tip, .xc-cols li > :focus-visible .xc-tip { display: block; }
.xc-cols .xc-tip, .xc-cols li:first-child .xc-tip, .xc-cols li:last-child .xc-tip { left: 50%; right: auto; transform: translateX(-50%); top: -10px; bottom: auto; }
.xc-cols li.is-left .xc-tip { left: 0; transform: none; }
.xc-cols li.is-right .xc-tip { left: auto; right: 0; transform: none; }
.xc-v .xc-colbar, .xc-v.is-few .xc-colbar { width: min(30px, 38%); min-height: 1px; }
.xc-v.is-many .xc-colbar { width: 38%; }
.xc-v .xc-colbar.s0 { background: var(--xc-bar); }
.xc-v .xc-colbar em { color: var(--xc-ink); }
.xc-v .xc-colbar.k-bar2, .xc-v .xc-colbar.s1 { background: var(--xc-b2); }
.xc-v .xc-colbar.age0 { background: #6f8494; } .xc-v .xc-colbar.age1 { background: #cf9f4e; } .xc-v .xc-colbar.age2 { background: #bd7328; } .xc-v .xc-colbar.age3 { background: #a64c1e; } .xc-v .xc-colbar.age4 { background: #8a2a1d; }
.xc-v .xc-colbar[class*="age"] { width: min(46px, 62%); }

/* Ranked bars with a comparison marker */
.xc-h .xc-row, .xc-h .xc-xaxis { grid-template-columns: var(--xc-label) minmax(0, 1fr) var(--xc-value) 66px; column-gap: 10px; }
.xc-h .h-rows { margin-top: 10px; }
.xc-h .xc-row { min-height: 42px; }
.xc-area u { position: absolute; top: 50%; width: 3px; height: 24px; margin: -12px 0 0 -1.5px; border-radius: 1px; background: #b9772b; box-shadow: 0 0 0 1px #fffdf9; text-decoration: none; }
.xc-note { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--xc-ink2); text-align: right; white-space: nowrap; }
.xc-note.bad { color: #9d2c1f; }
.xc-note.good { color: #2c6a45; }
.xc-row:hover .xc-tip, .xc-row:focus-visible .xc-tip { display: block; }

/* Balance line */
.s-end { position: absolute; right: 0; margin-bottom: 8px; padding: 0 4px; border-radius: 4px; background: rgba(255, 253, 249, .9); font-size: 12px; font-style: normal; font-weight: 700; }
.xc-s .t-area { opacity: .1; }

@media (max-width: 639px) {
  .xc { --xc-h: 190px; }
  .xc-frame { grid-template-columns: 44px minmax(0, 1fr); }
  .t-val { display: none; }
  .t-hits > li:last-child .t-val { display: block; left: auto; right: 0; transform: none; font-size: 12px; }
  .t-x span.is-minor { visibility: hidden; }
  .xc-xlabels span { width: auto; white-space: nowrap; font-size: 12px; }
  .t-x span { overflow: visible; display: flex; justify-content: center; }
  .xc-v:not(.is-few) .xc-xlabels span { white-space: normal; width: min-content; text-align: center; }
  .xc-v.is-many .xc-xlabels span:nth-child(even) { visibility: hidden; }
  .xc-v.is-many .xc-xlabels span { white-space: nowrap; width: auto; }
  .xc-v .xc-colbar em { display: none; }
  .xc-v.is-few .xc-colbar[class*="age"] em { display: block; font-size: 12px; }
  .xc-h .xc-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "label value note" "area area area"; row-gap: 7px; column-gap: 8px; }
  .xc-h .xc-note { grid-area: note; font-size: 12.5px; }
  .xc-h .xc-xaxis { grid-template-columns: minmax(0, 1fr); }
  .xc-h .xc-xaxis > span:first-child { display: none; }
  .xc-area u { height: 20px; margin-top: -10px; }
  .xc-xticks b { font-size: 12px; }
  .xc-xticks b:nth-last-child(even) { display: none; }
}

/* Narrow cards show every other tick so labels never touch */
.xc-h { container-type: inline-size; }
@container (max-width: 520px) { .xc-h .xc-ticks b:nth-child(even) { visibility: hidden; } }
.xc-v { container-type: inline-size; }
@container (max-width: 620px) { .xc-v.is-two .xc-colbar em { display: none; } }
