.viewer-area {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  background: white;
  height: 100dvh;
  z-index: 999;

  @media (width >= 768px) {
    height: auto;
    position: static;
  }

  border-left: 1px solid var(--medium-gray);
  flex: 1;
  display: flex;
  flex-direction: column;

  & article {
    flex: 1;
    overflow-y: auto;
  }

  .viewer {
    height: 0;

    .metadata {
      padding: 1rem;

    }

    & h3 {
      font-weight: 500;
      font-size: 1.375rem;
      position: relative;

      & small {
        font-size: 0.875rem;

        & a {
          background-color: rgb(0 0 0 / 5%);
          padding: 2px 6px;
          text-decoration: none;

          &:hover,
          &:active,
          &:focus {
            background-color: rgb(0 0 0 / 15%);
          }
        }
      }
    }

    & h5 {
      margin: 0;
    }

    & section {
      padding: 1rem;
    }

    & section.section-batch {
      padding: 0 1rem;
    }

    & section.section-link {
      display: flex;
      gap: 1rem;

      & > div {
        display: flex;
        flex: 1;
      }

      & p {
        margin-bottom: 0;
      }

      & ul {
        list-style: none;
        margin: auto 0;
        padding: 0;
        width: 100%;

        & a {
          align-items: center;
          display: flex;
          padding: 0.25rem 0;
          text-decoration: none;

          & span {
            flex: 1;
          }
        }
      }
    }

    & section.section-link div.section-link--primary a {
      align-items: center;
      border: 1px solid var(--light-gray);
      border-radius: 0.5rem;
      display: flex;
      flex: 1;
      padding: 1rem;
      text-decoration: none;

      & .fa-chevron-right {
        opacity: 0.25;
      }
    }

    & section.section-link div.section-link--primary a:hover,
    & section.section-link div.section-link--primary a:active,
    & section.section-link div.section-link--primary a:focus {
      border: 1px solid var(--medium-gray);

      & .fa-chevron-right {
        color: var(--dark-purple);
        opacity: 1;
      }
    }

    & section.section-link div.section-link--primary a div {
      flex: 1;
    }

    & section.section-link div.section-link--secondary a {
      & .fa-chevron-right {
        opacity: 0.25;
      }
    }

    & section.section-link div.section-link--secondary a:hover,
    & section.section-link div.section-link--secondary a:active,
    & section.section-link div.section-link--secondary a:focus {
      & .fa-chevron-right {
        color: var(--dark-purple);
        opacity: 1;
      }
    }

    & section.section-custom-fields {
      padding: 0 1rem;

      & ul {
        margin: 0;

        & li {
          padding: 0;
        }
      }

      & a {
        align-items: center;
        display: flex;
        flex: 1;
        padding: 1rem 0;
        text-decoration: none;

        & svg {
          opacity: 0.25;
        }
      }

      & a:hover,
      & a:active,
      & a:focus {
        & svg {
          color: var(--dark-purple);
          opacity: 1;
        }
      }
    }

    & section.section-messages {
      padding: 0 1rem;

      & li {
        padding: 1rem 0;
      }
    }

    & section.section-guests {
      padding: 0 1rem;

      & ul {
        list-style: none;
        margin: 0;
        padding: 0;

        & li {
          padding: 0;

          & .unallocated,
          & a {
            align-items: center;
            display: flex;
            padding: 1rem 0;
            text-decoration: none;

            & .fa-chevron-right {
              opacity: 0.25;
            }

            & div {
              display: flex;
              flex: 1;
              gap: 1rem;
            }
          }

          & a:hover,
          & a:active,
          & a:focus {
            & .fa-chevron-right {
              color: var(--dark-purple);
              opacity: 1;
            }
          }
        }

        & li + li {
          border-top: 1px solid var(--light-gray);
        }
      }
    }

    & section.section-source {
      padding: 0;

      & a {
        align-items: center;
        display: flex;
        gap: 1rem;
        padding: 1rem;
        text-decoration: none;

        & .fa-chevron-right {
          opacity: 0.25;
        }
      }

      & a:hover,
      & a:active,
      & a:focus {
        & .fa-chevron-right {
          color: var(--dark-purple);
          opacity: 1;
        }
      }
    }

    & section.section-digital-passes {
      padding: 0.5rem 1rem;
    }

    & section.section-checkins {
      padding: 0.25rem 1rem;
    }

    & section.section-custom-domain {
      padding: 0 1rem;
      width: 100%;

      & ul {
        list-style: none;
        margin: 0;
        padding: 0;

        & li {
          align-items: center;
          display: flex;
          justify-content: space-between;
          padding: 0.5rem 0;
        }

        & li + li {
          border-top: 1px solid var(--light-gray);
        }
      }
    }

    & > section + section {
      border-top: 1px solid var(--light-gray);
    }

    & pre {
      background-color: var(--gray-100);
      border: 1px solid var(--gray-200);
      border-radius: 0.25rem;
      display: inline-block;
      margin: 0;
      padding: 0.1rem 0.25rem;
    }

    & code {
      display: block;
      overflow: hidden;
      word-break: break-all;

      &.inline {
        display: inline;
        background-color: inherit;
      }
    }

    & header {
      align-items: center;
      border-bottom: 1px solid var(--light-gray);
      display: flex;
      gap: 0.5rem;
      padding: 1rem;

      & h3,
      & > div:nth-child(1) {
        flex: 1;
      }

      & .btn:not[.btn-success]:hover,
      & .btn:not[.btn-success]:active,
      & .btn:not[.btn-success]:focus {
        background-color: var(--light-purple);
      }

      & .btn-close:hover,
      & .btn-close:active,
      & .btn-close:focus,
      & .dropdown button:hover,
      & .dropdown button:active,
      & .dropdown button:focus {
        background-color: var(--light-purple);
      }

      & small.muted {
        color: var(--dark-gray);
        display: block;
        margin-top: 0.5rem;
      }
    }

    & header.subheader {
      width: 100%;
      background-color: var(--light-purple);
      border-top: 1px solid var(--light-gray);

      & h4 {
        flex: 1;
        font-size: 1.25rem;
        font-weight: 500;
      }

      & .btn {
        background-color: white;

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

    & header + header.subheader {
      border-top: none;
    }

    & header.subheader.with-btn {
      padding-top: 0.625rem;
      padding-bottom: 0.625rem;
    }

    & header.subheader.form-subheader {
      margin: 1rem -1rem;
      padding: 1rem !important;
    }
  }

  & section h4 {
    align-items: center;
    display: flex;
    font-size: 1.125rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }

  & section h4 .btn {
    font-size: 1rem;
    font-weight: normal;
  }

  & section h5 {
    font-size: 1.125rem;
    font-weight: 500;
  }

  & section dl {
    & dt {
      color: var(--gray-500);
      font-size: 0.875rem;
      font-weight: 500;
      line-height: 1.75rem;
    }

    & dd {
      word-break: break-word;

      & a {
        display: block;
        text-decoration: none;

        & .fa-chevron-right {
          opacity: 0.25;
        }
      }

      & a:hover,
      & a:active,
      & a:focus {
        & .fa-chevron-right {
          color: var(--dark-purple);
          opacity: 1;
        }
      }

      & .btn-group {
        & form .btn {
          border-radius: 0;
          margin-left: -1px;
        }

        & form:first-child .btn {
          border-radius: 4px 0 0 4px;
        }

        & form:last-child .btn {
          border-radius: 0 4px 4px 0;
        }
      }
    }
  }

  & section dl:not([class]) {
    & div {
      align-items: center;
      display: flex;
      word-wrap: break-word;
    }
  }

  & section dl.cols-two {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0;

    @media (width >= 768px) {
      gap: 1rem 1rem;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    &.cols-two--tight {
      gap: 0.25rem;
    }

    & dd + dt {
      @media (width < 769px) {
        margin-top: 1rem;
      }
    }
  }

  & section dl.min-content {
    align-items: baseline;
    grid-template-columns: min-content 1fr;
    row-gap: 0.25rem;
  }

  .viewer-list {
    list-style-type: none;
    margin: 0;
    padding: 0;

    & li .line,
    & li turbo-frame {
      align-items: center;
      display: flex;
      gap: 1rem;
      padding: 0.5rem 0;

      &.multiline {
        display: block;
      }

      & div {
        align-items: center;
        display: flex;
        flex: 1;
        flex-wrap: wrap;
        gap: 0.5rem;

        & span {
          font-size: 0.875rem;
        }
      }
    }

    & li + li {
      border-top: 1px solid var(--gray-300);
    }

    li a {
      text-decoration: none;
    }
  }

  & .viewer--invite-stats {
    & .invite-stats--row-1 {
      gap: 1rem 1rem;
      display: grid;
      grid-template-columns: 1fr;
      margin-bottom: 1rem;

      @media (width >= 500px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      @media (width >= 768px) {
        grid-template-columns: 1fr;
      }

      @media (width >= 1200px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    & .invite-stats--row-2 {
      gap: 1rem 1rem;
      display: grid;
      grid-template-columns: 1fr;

      @media (width >= 500px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      @media (width >= 768px) {
        grid-template-columns: 1fr;
      }

      @media (width >= 1200px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    & data {
      background-color: #fff;
      border: 1px solid var(--gray-300);
      display: flex;
      flex-direction: column;
      overflow: hidden;

      & h2 {
        margin: 0;
      }

      & header {
        margin: 0 1rem;
        padding: 0.75rem 0;
      }

      &.list-links ul {
        display: flex;
        flex: 1;
        flex-direction: column;
        list-style: none;
        padding: 0.5rem 0;
      }

      &.list-links li {
        padding: 0;
      }

      &.list-links ul li a {
        color: var(--gray-700);
        display: flex;
        font-size: 0.875rem;
        gap: 1rem;
        justify-content: space-between;
        padding: 0.25rem 1rem;
        text-decoration: none;
        width: 100%;
      }

      &.list-links ul li a:hover,
      &.list-links ul li a:focus,
      &.list-links ul li a:active {
        background-color: var(--scampi-50);
      }

      &.list-links ul li.list-total a {
        font-size: 1rem;
        font-weight: bold;
      }

      & > div {
        align-items: center;
        color: black;
        display: flex;
        flex: 1;
        font-size: 1rem;
        font-weight: 900;
        gap: 1rem;
        padding: 0.5rem 1rem;

        @media (width >= 500px) {
          align-items: normal;
          flex-direction: column;
          font-size: 3.25rem;
          gap: 0;
          justify-content: center;
        }

        @media (width >= 768px) {
          align-items: center;
          flex-direction: row;
          font-size: 1rem;
          gap: 1rem;
          justify-content: flex-start;
        }

        @media (width >= 1200px) {
          align-items: normal;
          flex-direction: column;
          font-size: 3.25rem;
          gap: 0;
          justify-content: center;
        }

        & a {
          color: var(--scampi-700);
          font-size: 0.875rem;
          font-weight: 300;
          text-decoration: none;
        }

        & a:hover,
        & a:focus,
        & a:active {
          text-decoration: underline;
        }

        & a.widget-text {
          color: var(--gray-500);
        }

        & a.widget-text:hover {
          color: var(--gray-700);
        }

        & b {
          color: black;
          flex: 1;
          font-size: 1.125rem;
          font-weight: 700;

          @media (width >= 1200px) {
            border-bottom: 1px solid var(--medium-gray);
            padding-bottom: 0.5rem;
            margin-bottom: 0.25rem;
          }
        }

        & aside {
          display: inline;
        }
      }
    }
  }
}
