@layer sellect-theme {
  html#shellDemo #complexGalleryDialog,
  html#shellDemo #complexGalleryDialog *,
  html#shellDemo #complexCoverageScreen.cp-page .fp-complex-gallery,
  html#shellDemo #complexCoverageScreen.cp-page .fp-complex-gallery * {
    user-select: none !important;
    -webkit-user-select: none !important;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-complex-gallery {
    padding: 0 !important;
    gap: 14px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-stage {
    border-radius: var(--sl-radius-media) !important;
    isolation: isolate;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-main::after {
    content: '';
    position: absolute;
    inset: 65% 0 0;
    background: linear-gradient(transparent, rgb(8 16 24 / 32%));
    pointer-events: none;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-position {
    left: 22px !important;
    bottom: 20px !important;
    z-index: 1;
    padding: 0 10px !important;
    background: rgb(17 25 35 / 52%) !important;
    backdrop-filter: blur(10px);
    border-radius: 8px !important;
    line-height: 28px !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: .3px;
    text-shadow: 0 1px 8px rgb(0 0 0 / 25%);
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-expand {
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    right: 20px !important;
    bottom: 17px !important;
    z-index: 1;
    padding: 8px 0 !important;
    background: transparent !important;
    color: white !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 14px !important;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-expand svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-arrow {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: rgb(17 25 35 / 52%) !important;
    color: white !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity .18s ease, background .18s ease;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-stage:hover .fp-gallery-arrow,
  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-stage:focus-within .fp-gallery-arrow {
    opacity: 1;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-arrow:hover {
    background: rgb(17 25 35 / 65%) !important;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-thumbs {
    position: relative;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    height: 80px !important;
    min-height: 80px !important;
    flex-basis: 80px !important;
    padding: 3px !important;
    margin: -3px !important;
    gap: 8px !important;
    overflow: hidden !important;
    scrollbar-width: none;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-thumbs .cd-thumb {
    position: relative;
    min-width: 0 !important;
    width: 100% !important;
    height: 72px !important;
    padding: 3px !important;
    border: 1.5px solid transparent !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-thumbs .cd-thumb img {
    border-radius: 7px !important;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-thumbs .cd-thumb:hover {
    border-color: #bcc8d9 !important;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-thumbs .cd-thumb[aria-pressed=true] {
    border-color: var(--sl-accent) !important;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-all > span {
    position: absolute;
    inset: 3px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgb(15 19 22 / 65%) !important;
    border-radius: 7px !important;
    color: white !important;
    font-size: 20px;
    font-weight: 600;
  }

  html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-all small {
    font-size: 11px;
    font-weight: 400;
  }

  html#shellDemo #complexGalleryDialog {
    box-sizing: border-box !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgb(23 27 32 / 94%) !important;
    color: #f6f7f8 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  html#shellDemo #complexGalleryDialog[open] {
    display: grid !important;
    grid-template-rows: 76px minmax(0, 1fr) 100px;
  }

  html#shellDemo #complexGalleryDialog::backdrop {
    background: transparent !important;
    backdrop-filter: blur(12px) !important;
  }

  html#shellDemo #complexGalleryDialog [hidden] {
    display: none !important;
  }

  html#shellDemo #complexGalleryDialog .cg-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 0 26px;
  }

  html#shellDemo #complexGalleryDialog h2 {
    flex: 1;
    min-width: 0;
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    color: inherit !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html#shellDemo #complexGalleryDialog .cg-counter {
    flex: none;
    color: #a9b0b6;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
  }

  html#shellDemo #complexGalleryDialog button {
    font: inherit;
    color: inherit !important;
    cursor: pointer;
  }

  html#shellDemo #complexGalleryDialog button:focus-visible {
    outline: 2px solid #b5c7ff !important;
    outline-offset: 3px;
  }

  html#shellDemo #complexGalleryDialog .cg-close {
    justify-self: end;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 10px;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
  }

  html#shellDemo #complexGalleryDialog .cg-close:hover {
    background: rgb(255 255 255 / 8%) !important;
  }

  html#shellDemo #complexGalleryDialog svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }

  html#shellDemo #complexGalleryDialog .cg-close svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.8;
  }

  html#shellDemo #complexGalleryDialog .cg-stage {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 24px;
    min-height: 0;
    padding: 0 24px 8px;
  }

  html#shellDemo #complexGalleryDialog .cg-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
  }

  html#shellDemo #complexGalleryDialog .cg-photo > img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 8px;
    object-fit: contain;
    transition: opacity .18s ease;
  }

  html#shellDemo #complexGalleryDialog .cg-photo.is-loading > img {
    opacity: .5;
  }

  html#shellDemo #complexGalleryDialog .cg-arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: rgb(255 255 255 / 4%) !important;
    border: 1px solid rgb(255 255 255 / 12%) !important;
    border-radius: 50% !important;
  }

  html#shellDemo #complexGalleryDialog .cg-arrow:hover:not(:disabled) {
    background: rgb(255 255 255 / 12%) !important;
  }

  html#shellDemo #complexGalleryDialog .cg-arrow:disabled {
    opacity: .2 !important;
    cursor: default;
  }

  html#shellDemo #complexGalleryDialog .cg-thumbnails {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: calc(100% - 48px);
    margin: 0 auto;
    padding: 12px 4px 20px;
    box-sizing: border-box;
    overflow-x: auto;
    scrollbar-width: none;
  }

  html#shellDemo #complexGalleryDialog .cg-thumbnails button {
    width: 94px;
    height: 66px;
    flex: none;
    padding: 3px;
    border: 1.5px solid transparent !important;
    border-radius: 11px !important;
    background: transparent !important;
    opacity: 1;
  }

  html#shellDemo #complexGalleryDialog .cg-thumbnails button:hover,
  html#shellDemo #complexGalleryDialog .cg-thumbnails button[aria-pressed=true] {
    opacity: 1;
  }

  html#shellDemo #complexGalleryDialog .cg-thumbnails button[aria-pressed=true] {
    border-color: #f6f7f8 !important;
  }

  html#shellDemo #complexGalleryDialog .cg-thumbnails img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
  }

  html#shellDemo #complexGalleryDialog .cg-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 15px;
  }

  html#shellDemo #complexGalleryDialog .cg-error button {
    padding: 10px 18px;
    border: 1px solid #52616c;
    border-radius: var(--sl-radius-control);
    background: transparent;
  }

  html#shellDemo #complexGalleryDialog.cg-single[open] {
    grid-template-rows: 76px minmax(0, 1fr) 24px;
  }

  html#shellDemo #complexGalleryDialog.cg-single .cg-thumbnails,
  html#shellDemo #complexGalleryDialog.cg-single .cg-arrow {
    visibility: hidden;
  }

  @media (hover: none) {
    html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-arrow {
      opacity: 1;
    }
  }

  @media (max-width: 600px) {
    html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-thumbs {
      height: 70px !important;
      min-height: 70px !important;
      flex-basis: 70px !important;
      gap: 5px !important;
    }
    html#shellDemo #complexCoverageScreen.cp-page .fp-gallery-thumbs .cd-thumb {
      width: 100% !important;
      height: 62px !important;
    }
    html#shellDemo #complexGalleryDialog {
      width: 100vw !important;
      height: 100dvh !important;
      border: 0 !important;
      border-radius: 0 !important;
    }
    html#shellDemo #complexGalleryDialog[open] {
      grid-template-rows: calc(66px + env(safe-area-inset-top)) minmax(0, 1fr) calc(86px + env(safe-area-inset-bottom));
    }
    html#shellDemo #complexGalleryDialog .cg-header {
      padding: env(safe-area-inset-top) 12px 0 18px;
      gap: 12px;
    }
    html#shellDemo #complexGalleryDialog h2 {
      font-size: 18px !important;
    }
    html#shellDemo #complexGalleryDialog .cg-stage {
      position: relative;
      display: block;
      padding: 0 0 8px;
    }
    html#shellDemo #complexGalleryDialog .cg-arrow {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 1;
      width: 44px;
      height: 44px;
      background: rgb(17 25 35 / 65%) !important;
      border-radius: 50% !important;
    }
    html#shellDemo #complexGalleryDialog .cg-previous {left: 10px;}
    html#shellDemo #complexGalleryDialog .cg-next {right: 10px;}
    html#shellDemo #complexGalleryDialog .cg-thumbnails {
      max-width: calc(100% - 24px);
      padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
    html#shellDemo #complexGalleryDialog .cg-thumbnails button {
      width: 72px;
      height: 50px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html#shellDemo .fp-gallery-arrow,
    html#shellDemo #complexGalleryDialog img {
      transition: none !important;
    }
  }
}
