#heatmap {
  height: 100%;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: var(--main-padding);

  > header {
    flex-shrink: 0;
    display: flex;
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: -0.25rem;
    padding-left: var(--main-padding);
    margin-left: var(--negative-main-padding);
    padding-right: var(--main-padding);
    margin-right: var(--negative-main-padding);
  }

  > fieldset {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: baseline;
    flex-shrink: 0;
    text-transform: lowercase;
    overflow-x: auto;
    min-width: 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-sm);
    margin: 0.5rem var(--negative-main-padding);
    padding: 0.5rem var(--main-padding);
    gap: 1rem;

    @media (max-width: 767px) {
      grid-auto-flow: row;
      grid-template-columns: repeat(2, max-content);
    }

    > label {
      display: flex;
      align-items: baseline;
      flex-shrink: 0;
      gap: 0.5rem;
      cursor: pointer;
      color: var(--color);

      > span:first-child {
        color: var(--off-color);
      }

      select {
        width: auto;
        line-height: 1;
      }
    }
  }

  > canvas {
    background-color: var(--black);

    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    display: block;
    image-rendering: pixelated;
    touch-action: manipulation;
  }

  > [role="tooltip"] {
    position: absolute;
    z-index: 1;
    max-width: min(18rem, calc(100% - 1rem));
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--color);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-xs);
    pointer-events: none;
    white-space: pre;
  }
}
