.share.context {
  & > span {
    min-width: 230px;

    .share-heading {
      margin-top: 5px;
      margin-bottom: 0;
    }

    .form {
      padding-top: 0;
      padding-bottom: 0;

      label {
        font-size: 0.9em;
        margin-top: 0.1em;
      }

      input,
      textarea {
        font-size: 0.8em;
      }
    }
  }
}

body.viewer {
  .sidebar {
    display: none;

    @media (min-width: $screen-sm-min) {
      display: block;
    }
  }

  .page-tools {
    float: right;
    display: block;

    li {
      display: inline-block;
      width: 26px;
      position: relative;

      a {
        color: $grey;
        text-decoration: none;
        cursor: pointer;
        display: block;
        height: 26px;
        overflow: hidden;

        &:hover {
          color: $primary-colour;
        }
      }

      svg {
        width: 26px;
        height: 26px;
        fill: currentColor;

        & + span {
          @include text-hide;
        }
      }

      & > span {
        @include context-menu (left);
      }
    }
  }

  .package-title {
    border-bottom: solid 1px $light-grey;
    font-size: 22px;
    margin-top: 0;
    margin-bottom: $grid-gutter-width;
    padding-bottom: $padding-base-vertical;

    svg {
      fill: currentColor;
      width: 26px;
      height: 26px;
      float: left;
      position: relative;
      top: -1px;

      & + span {
        display: block;
        margin-left: 32px;
      }
    }
  }

  .description {
    font-size: 15px;
    margin-bottom: $grid-gutter-width;

    :last-child {
      margin-bottom: 0;
    }
  }

  a.add.visualisation {
    display: none;

    @media (min-width: $screen-sm-min) {
      @include add-box();

      border-radius: $border-radius-base;
      margin-bottom: $grid-gutter-width;
      font-size: 14px;

      @include transition(padding, 0.3s);

      span {
        display: block;
      }

      &:hover {
        padding-top: $grid-gutter-width*1.5;
        padding-bottom: $grid-gutter-width*1.5;
      }
    }
  }

  .chart {
    margin-bottom: $grid-gutter-width;
    display: none;

    @media (min-width: $screen-sm-min) {
      display: block;
    }

    & > article {
      background-color: #fff;
      border: solid 1px $light-grey;
      border-radius: $border-radius-base;

      .chart-header {
        padding: $grid-gutter-width/2;
        border-bottom: solid 1px $light-grey;

        .tools {
          float: right;
          position: relative;
          top: -4px;

          li {
            display: inline-block;
            position: relative;

            a {
              color: $light-grey;
              text-decoration: none;
              cursor: pointer;

              &:hover {
                color: $primary-colour;
              }
            }

            svg {
              width: 30px;
              height: 30px;
              fill: currentColor;

              & + span {
                @include text-hide;
              }
            }

            & > span {
              @include context-menu (left);

              width: 230px;
              padding: 10px;

              &.active {
                & ~ a {
                  color: $grey;
                }
              }
            }

            &.remove {
              & > span {
                button {
                  display: block;
                  width: 100%;

                  & + button {
                    margin-top: 10px;
                  }
                }
              }
            }

            &.share {
              & > span {
                padding: 0;

                .form {
                  padding-top: 0;
                  padding-bottom: 0;
                }
              }
            }
          }
        }

        .breadcrumb {
          padding: 0;
          margin: 0;
        }
      }

      .chart-body {
        .chart-main,
        .chart-info {
          & > div {
            padding: $grid-gutter-width/2;
          }
        }

        .chart-main {
          & > div {
            padding-bottom: $grid-gutter-width/4;
          }
        }

        .chart-info {
          & > div {
            padding-top: $grid-gutter-width/4;

            .chart-title {
              font-size: 17px;
              margin-bottom: 0.1em;
            }

            p {
              font-size: 13px;
            }

            :last-child {
              margin-bottom: 0;
            }
          }
        }

        @media (min-width: $screen-lg-min) {
          display: table;
          width: 100%;

          .chart-main,
          .chart-info {
            display: table-cell;
          }

          .chart-main {
            width: 70%;

            & > div {
              padding: 2px $grid-gutter-width/4 $grid-gutter-width/2 $grid-gutter-width/2;
            }
          }

          .chart-info {
            vertical-align: bottom;

            & > div {
              padding: $grid-gutter-width/2 $grid-gutter-width/2 $grid-gutter-width/2 $grid-gutter-width/4;
            }
          }
        }
      }
    }

    & + a.add.visualisation,
    a.add.visualisation {
      padding-top: $grid-gutter-width*0.25;
      padding-bottom: $grid-gutter-width*0.25;
      background-color: transparent;

      @include transition-delay(0.2s);

      .verbose {
        @include text-hide;
      }

      &:hover {
        padding-top: $grid-gutter-width*0.5;
        padding-bottom: $grid-gutter-width*0.5;
      }
    }
  }

  .table-view {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    background-color: lighten($lighter-grey, 2);
    border: solid 1px $light-grey;
    border-radius: $border-radius-base;

    table {
      min-width: 100%;

      thead {
        background-color: #fff;
      }

      th {
        padding: $grid-gutter-width/2;
        font-size: 14px;
      }

      td {
        padding: $padding-base-vertical $grid-gutter-width/2;
        border-top: solid 1px $light-grey;
        font-size: 13px;
      }

      tr:hover {
        td {
          background-color: rgba($primary-colour, 0.1);
        }
      }
    }
  }
}

.visualisation-selection {
  display: block;
  padding: 0;
  margin: 0 -10px;

  @include clearfix;

  li {
    display: block;
    padding: 10px;
    text-align: center;
    line-height: 1;

    @media (min-width: $screen-sm-min) {
      float: left;
      width: 20%;
    }

    svg {
      fill: currentColor;
      width: 100%;
      height: 64px;
      display: block;
      margin-bottom: 4px;
    }

    a {
      display: block;
      border: solid 1px rgba(#fff, 0.1);
      padding: 10px;
      text-decoration: none;
      overflow: hidden;
      font-weight: normal;

      @media (min-width: $screen-sm-min) {
        height: 113px;
        padding-bottom: 0;
      }

      &.disabled {
        color: rgba(#fff, 0.3);

        svg {
          fill: rgba(#fff, 0.1);
        }
      }

      &:not(.disabled):hover {
        color: $primary-colour;
        border-color: $primary-colour;
      }
    }
  }
}
