.investments {
  width: 100%;
  max-width: none;
  max-width: 70em;
  box-sizing: border-box;
}

#charts {
  border: none;
  margin: 0;

  svg {
    width: 100%;
    display: block;
  }

  .line {
    stroke: var(--fg-color);
    stroke-width: 2;
    stroke-opacity: 0.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    fill: none;
  }

  .current-data {
    fill: var(--fg-color);
  }

  .hover-line {
    stroke: var(--fg-color);
    stroke-opacity: 0.4;
  }

  .hover-dot {
    fill: var(--fg-color);
    opacity: 0.75;
  }
}

:root {
  --sidebar-width: 15rem;
}

.chart-options {
  margin: 0 1rem 1rem;
  font-size: 0.875em;
  color: var(--mid-color);

  display: grid;
  grid-template-columns: 1fr 2rem;
  align-items: center;

  .chart-date {
    color: var(--fg-color);
    font-feature-settings: 'tnum' off, 'cv02';
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
  }
  .report-link {
    color: var(--mid-color);
    font-size: 0.875em;
  }

  label {
    display: block;
    padding: 0;
    width: 2rem;
    height: 2rem;
    background-color: transparent;
    border: 0.25rem solid var(--border-color);
    border-radius: 1rem;
    box-sizing: border-box;
    transition: background-color 0.4s ease-out;
    transition: border-color 0.2s ease-out;

    &:hover {
      border-color: var(--focus-dark-color);
    }
  }

  input[type="checkbox"]:checked ~ label {
    border-color: var(--mid-color);
    background-color: var(--mid-color);
  }

  input[type="checkbox"] {
    display: none;
  }
}

.chart-toggle {
  font-size: 0.875em;

  & > button, & > a {
    flex: auto;
    width: auto;
    margin-top: 0;
  }
}

.investment-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 0.25rem;
  padding: 1rem;
  text-align: right;
  margin: 0;

  div {
    margin: 0 0 1em;
  }

  dt {
    color: var(--mid-color);
    font-size: 0.875em;
  }

  dd {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0;
  }
}

@media (prefers-color-scheme: dark) {
  #charts .current-data {
    text-shadow: rgba(0, 0, 0, 0.5) 0 0.1em 0.5em;
  }
  #barChart text {
    text-shadow: rgba(0, 0, 0, 0.5) 0 0.1em 0.25em;
  }
  .investment-summary dd,
  .chart-options .chart-date {
    text-shadow: rgba(0, 0, 0, 0.5) 0 0.1em 0.25em;
  }
}

@media screen and (min-width: 24em) {
  .investment-summary {
    dd {
      font-size: 1.5rem;
    }
  }
}

@media screen and (min-width: 45em) {
  #charts {
    margin: 0;
  }

  .investment-summary {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .investments {
    padding: 1em;
    display: flex;

    aside {
      width: 12rem;
      margin-right: 1.5rem;
    }
    main {
      flex: 1;
    }
  }

  .chart-options {
    margin: 0 0 1rem;
  }
}

@media screen and (min-width: 50em) {
  .investments aside {
    width: 15rem;
  }

  .investment-summary {
    dd {
      font-size: 1.5em;
    }
  }
}
