/* Revenue chart of the SeinovFlow "Início" (js/seinovflow/chart.js). Colors only through tokens.
   The chart fills the card it is put in: the card gives the height (198px on the computer) and
   no inner padding; the paddings are inside the drawing. */
.revchart {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 120px;
  border-radius: inherit;
  color: var(--color-ink);
  touch-action: pan-y; /* a sideways drag walks the points; up and down still scrolls the page */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.revchart:focus {
  outline: none;
}

.revchart:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -3px;
}

.revchart__svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Axes */
.revchart__line {
  stroke: var(--color-border);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.revchart__value,
.revchart__label {
  fill: var(--color-ink-subtle);
  font-family: var(--font-sans);
  font-size: var(--font-size-2xs);
  font-variant-numeric: tabular-nums;
  dominant-baseline: central;
}

.revchart__value {
  text-anchor: end;
}

.revchart__label {
  text-anchor: middle;
}

/* Lines: current period solid over a soft fade, previous period dashed */
.revchart__fade-top {
  stop-color: var(--color-ink);
  stop-opacity: 0.16;
}

.revchart__fade-bottom {
  stop-color: var(--color-ink);
  stop-opacity: 0;
}

.revchart__now,
.revchart__before {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.revchart__now {
  stroke: var(--color-ink);
  stroke-width: 2;
}

.revchart__before {
  stroke: var(--color-ink-subtle);
  stroke-width: 1.25;
  stroke-dasharray: 4 3;
}

.revchart__dot {
  fill: var(--color-accent);
}

/* Hover / touch / keyboard */
.revchart__cursor {
  stroke: var(--color-ink-subtle);
  stroke-width: 1;
  stroke-opacity: 0.7;
}

.revchart__mark--current {
  fill: var(--color-ink);
  stroke: var(--color-surface);
  stroke-width: 2;
}

.revchart__mark--previous {
  fill: var(--color-surface);
  stroke: var(--color-ink-subtle);
  stroke-width: 1.5;
}

.revchart__tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  min-width: 9.5rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  box-shadow: var(--shadow-md);
  font-size: var(--font-size-xs);
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}

.revchart__tip[hidden] {
  display: none;
}

.revchart__tip p {
  margin: 0;
}

.revchart__tip-title {
  margin-bottom: var(--space-1);
  font-weight: 600;
  color: var(--color-ink);
}

.revchart__tip-row {
  display: grid;
  grid-template-columns: 0.875rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-2);
  color: var(--color-ink-muted);
}

.revchart__tip-value {
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.revchart__key {
  display: block;
  height: 0;
  border-top: 2px solid var(--color-ink);
}

.revchart__key--previous {
  border-top: 2px dashed var(--color-ink-subtle);
}

/* For screen readers only (description table and the value read while walking with the arrows) */
.revchart__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
