header.account-header {
  position: relative;
  text-align: left;
  border: none;
  margin: 2em 0 1em;
  padding: 0;

  h1 {
    font-size: 2em;
    margin: 0.25em 0;
  }

  .currency-code {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 2.25rem;
    height: 2.25rem;
    border: 0.125rem solid var(--positive-color);

    color: var(--positive-color);
    font-size: 0.625rem;
    font-weight: bold;

    border-radius: 1.25rem;

    position: absolute;
    top: 0.25rem;;
    right: 0;
    transform: rotate(15deg);
  }

  nav {
    box-shadow: var(--border-color) 0 -0.0625rem 0 0 inset;
    display: flex;
    flex-direction: column-reverse;
  }

  ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-shrink: 0;

    li {
      flex-shrink: 0;
    }

    a, button {
      display: block;
      color: var(--mid-color);
      text-decoration: none;
      background: none;
      font-weight: inherit;
      line-height: inherit;

      width: auto;
      margin: 0;
      padding: 1em 1em;
      border-bottom: 0.125rem solid transparent;
      border-radius: 0;
      transition: 0.2s ease border-bottom-color;

      &:hover {
        border-bottom-color: var(--mid-color);
        transform: none;
      }

      &.active {
        color: var(--fg-color);
        border-bottom-color: var(--focus-color)
      }
    }

    &.actions {
      a {
        color: var(--bg-color);
        font-size: 0.875em;
        font-weight: normal;
        border: none;
        border-radius: 0.5em;
        background-color: var(--positive-color);
        margin: 0;
        padding: 0.5em 0.75em;
      }

      a.svg-link {
        display: block;
        padding: 0.32em 0.4em;
      }
    }

    &.more-menu {
      display: block;
      background: rgba(255,255,255,0.01);

      &.hidden { display: none; }
      a {

      }
    }
  }

  svg {
    width: calc(1.125rem);
    fill: var(--bg-color);
  }
}


table.balance-sheet {
  margin: 2em 0;
  font-size: 1rem;
  border-collapse: collapse;

  .date {
    text-align: center;
  }

  .main {
    font-weight: 700;
    color: var(--fg-color);
  }

  .currency {
    min-width: 7em;
    text-align: right;
  }

  .links {
    padding: 0;
    text-align: 0;

    a {
      display: block;
      padding: 0;
      margin: 0 0 0 0.5em;
      width: 1.4em;
      height: 1.4em;
    }

    svg {
      height: 1.4em;
      fill: var(--mid-color);
    }
  }

  th {
    color: var(--mid-color);
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;

    padding: 0.25rem;
    border-bottom: 0.0625rem solid var(--mid-color);
  }

  td {
    border-bottom: 0.0625rem solid var(--border-color);
  }
}

table.all-accounts {
  font-weight: 300;
  td.currency {
    font-size: 0.75em;
  }
}

#new-accounts {
  a {
    color: inherit;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

.account-summary {
  display: flex;
  margin: 0 0 1em;
  align-items: center;

  h2 {
    font-size: 2em;
    flex: 1;
  }
  table {
    font-size: 0.875rem;
    width: auto;
    margin: 0 auto;
    th {
      font-size: 0.625rem;
      text-align: right;
    }
    td {
      font-weight: bold;
      text-align: right;
      padding: 0 0 0 1em;
      min-width: 7em;
    }
  }
}


svg .axis .tick {
  color: var(--mid-color);
  fill: var(--mid-color);
}
svg .color-container {
  fill-opacity: 0.8;
}

.chart-toggle {
  display: flex;

  & > button, & > a {
    background-color: var(--border-color);

    text-align: center;
    text-transform: none;
    font-weight: bold;
    border-radius: 0;
    padding: 0.75em;
    box-shadow: none;

    transition: all ease 0.2s;

    &:hover {
      background-color: var(--focus-color);
      transform: translateY(-0.2em);
    }

    &.active {
      cursor: default;
      background-color: var(--mid-color);
      transform: translateY(0);
    }
  }
}

@media (prefers-color-scheme: dark) {
  svg .color-container {
    fill-opacity: 0.6;
  }
}

@media screen and (max-width: 33em) {
  table.balance-sheet {
    margin-top: 0;

    thead {
      tr { border-bottom: 0.0625rem solid var(--mid-color); }
      th {
        display: none;
        border: none;
      }
      th.date { display: inherit; }
    }
    tr {
      padding: 0.25em 0;
      position: relative;
      display: grid;
      grid-template-columns: 2fr 3fr;
      grid-template-rows: auto;
      grid-gap: 0.25em;
      border-bottom: 0.0625rem solid var(--border-color);
    }
    td {
      border: none;
      padding: 0;
    }
    .date {
      grid-column: 1;
      grid-row: 1 / span 3;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    &.profit-and-loss {
      tr {
        grid-template-columns: 1fr 2fr;
      }
      .date {
        grid-row: 1 / span 5;
      }
    }
    .main.currency {
      grid-column: 2;
      grid-row: 1;
    }
    .currency {
      position: relative;
    }
    .currency::before {
      content: attr(data-name);
      color: var(--mid-color);
      font-size: 0.625em;
      font-weight: 400;
      text-transform: uppercase;
      position: absolute;
      left: 0;
      top: 0.3em;
    }
    .diff.currency {
      grid-column: 2;
      grid-row: 2;
    }
    .transfers.currency {
      grid-column: 2;
      grid-row: 3;
    }
    .links {
      text-align: center;
      position: absolute;
      bottom: 0;
      left: 0;
      padding: 0;
      width: 40%;
      height: 40%;
      a {
        display: block;
        width: 100%;
        height: 100%;
        margin: 0;
      }
    }
  }
}

@media screen and (min-width: 25em) and (max-width: 33em) {
  table.balance-sheet tr {
    grid-template-columns: 1fr 1fr;
  }
  table.balance-sheet .links {
    width: 50%;
  }
}

@media screen and (min-width: 30em) {
  header.account-header {
    h1 {
      font-size: 3em;
    }
    nav {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
  }

}


