#ticket-shop-my-tickets-view {
  --content-width: 72rem;
  --content-gap: 1.6rem;
  --content-border-radius: 2.3rem;
  --content-padding-top: 2.4rem;

  > header[purpose="toolbar"] {
    > button[action="logout"] {
      @media (max-width: 470px) {
        padding: 0;

        span {
          display: none;
        }
      }
    }
  }

  > main {
    padding: 0 0.8rem var(--content-padding-top);
    display: flex;
    flex-direction: column;
    gap: var(--content-gap);
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
    isolation: isolate;

    &::before {
      content: "";
      position: sticky;
      top: 0;
      z-index: 1;
      align-self: center;
      margin-bottom: calc(0rem - var(--content-gap) - var(--content-border-radius));
      width: 100%;
      max-width: var(--content-width);
      height: calc(var(--content-padding-top) + var(--content-border-radius));
      flex: none;
      background: white;
    }

    > * {
      margin-inline: auto;
      width: 100%;
      max-width: var(--content-width);
    }

    > :is(.section, .profile, .group, .past)[hidden] {
      display: none;
    }

    > .profile {
      display: grid;
      gap: var(--content-gap);

      > .profile-data {
        margin: 0;
        border: var(--toolbar-border);
        border-radius: 1.6rem;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--viewkit-toolbar-border-width);
        overflow: clip;
        background: var(--toolbar-border-color);

        > div:not([hidden]) {
          padding: 1.2rem 1.4rem;
          display: grid;
          grid-template-columns: minmax(8rem, 1fr) 2fr;
          align-items: center;
          gap: 1.2rem;
          background: white;

          > dt {
            font-weight: 600;
          }

          > dd {
            min-width: 0;
            overflow-wrap: anywhere;

            > .available {
              display: block;
              white-space: pre-line;
            }

            > .add-balance {
              margin-top: 0.8rem;
              display: flex;
              gap: 0.4rem;

              &[hidden] {
                display: none;
              }

              > input {
                min-width: 0;
                width: 100%;
                text-transform: uppercase;
              }

              > button {
                width: 4.2rem;
                flex: none;
                padding-inline: 0;

                > .icon {
                  width: 2rem;
                  height: 2rem;
                }
              }
            }
          }
        }

        > .profile-expand:not([hidden]) {
          display: none;
        }

        > .password:not([hidden]) {
          grid-column: 1 / -1;
          grid-template-columns: minmax(8rem, 1fr) 5fr;

          > dd {
            justify-self: stretch;
            text-align: left;

            > .local-password {
              justify-content: flex-start;
              text-align: left;
            }
          }

          > dd > .remote-password:not([hidden]) {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0.2rem;
          }

          > dd > .remote-password > a {
            width: 100%;
            max-width: 100%;
            display: block;
            text-align: left;
            text-wrap: balance;
          }
        }

        .profile-address {
          white-space: pre-line;
        }
      }
    }

    > .empty {
      border: 3px solid var(--toolbar-background-color);
      border-radius: var(--content-border-radius);
      min-height: 16rem;
      overflow: clip;
    }

    > .section {
      position: sticky;
      top: var(--content-padding-top);
      z-index: 2;
      margin: 0 auto;
      border-radius: var(--content-border-radius);
      height: 4.6rem;
      display: flex;
      align-items: center;
      gap: 0.8rem;
      padding: 0.8rem 1.6rem;
      font-size: 2rem;
      font-weight: 600;
      background: var(--toolbar-background-color);

      > .icon {
        width: 2.8rem;
        height: 2.8rem;
        flex: none;
      }

      > .catalog-year {
        margin-left: auto;
        color: gray;
        font-size: 1.4rem;
        font-weight: 500;
      }
    }

    > .past-heading {
      padding: 0;

      > button {
        border-radius: inherit;
        padding: 0.8rem 1.6rem;
        width: 100%;
        min-height: 4.6rem;
        justify-content: start;
        background: transparent;
        font-size: inherit;
        font-weight: inherit;

        > .counter {
          margin-left: auto;
          border-radius: 100vmax;
          min-width: 2.8rem;
          height: 2.8rem;
          display: grid;
          place-items: center;
          padding-inline: 0.8rem;
          color: white;
          font-size: 1.4rem;
          background: var(--color-green);
        }

        &.expanded {
          color: black;
          cursor: default;

          > svg {
            display: none;
          }
        }
      }
    }

    > .past {
      > .past-content {
        display: grid;
        gap: 2.4rem;

        &[hidden] {
          display: none;
        }

        .past-year {
          > h3 {
            margin: 0 0 1.2rem;
            font-size: 1.8rem;
            text-align: center;
          }

          > .past-groups {
            display: grid;
            gap: 1.6rem;
          }
        }

        .past-group > h4 {
          margin: 0 0 0.8rem;
          padding-inline: 1.6rem;
          display: flex;
          align-items: center;
          gap: 0.6rem;
          font-size: 1.6rem;

          > .icon {
            width: 2.2rem;
            height: 2.2rem;
            flex: none;
          }
        }
      }
    }
  }

  @media (width < 680px) {
    > main > .profile {
      > .profile-data {
        grid-template-columns: minmax(0, 1fr);

        > div:not([hidden]) {
          grid-template-columns: 10.8rem minmax(0, 1fr);
          gap: 0.8rem;
        }

        > .password:not([hidden]) {
          grid-column: auto;
          grid-template-columns: 10.8rem minmax(0, 1fr);
        }

        > [data-profile-detail]:not([hidden]) {
          display: none;
        }

        > .profile-expand:not([hidden]) {
          padding-block: 0.8rem;
          display: grid;
          grid-template-columns: minmax(0, 1fr);

          > dd {
            display: flex;
            justify-content: center;
          }
        }
      }

      &[data-expanded] > .profile-data {
        > .profile-expand {
          display: none;
        }

        > [data-profile-detail]:not([hidden]) {
          display: grid;
        }
      }
    }
  }

  @media (width <= 420px) {
    --content-gap: 1.6rem;
    --content-padding-top: 1.6rem;

  }
}
