.stockpack-sidebar .stockpack-attribution.in-sidebar {
  display: block;
  width: auto;

  .attribution {
    position: static;
    width: auto;
    max-width: none;
    margin: 16px 0 12px;
  }
}

.media-toolbar {
  .stockpack-attribution {
    display: inline-block;
    &.hidden{
      display: none;
    }
    .attribution{
      margin-left: 0;
      margin-top: 23px;
      @include r(1080) {
        width: 280px;
        position: fixed;
        bottom:40px;
        max-width: 70%;
      }
      @include r(785) {
        bottom:20px;
      }

      @include r(640) {
        bottom:-11px;
      }
      @include r(520) {
        bottom:54px;
      }
    }
    .author-info{
      display: block;
    }
  }
}

.media-toolbar-primary.stockpack-generating {
    .search,
    label[for="stockpack-search-input"] {
        display: none !important;
    }

    .spinner {
        display: none !important;
    }
}

.stockpack-generate {
    display: none;
    align-items: center;
    gap: 4px;
    margin: 0 4px;
    max-width: 100%;
    min-width: 0;

    .stockpack-generate-prompt {
        min-width: 160px;
        flex: 1 1 220px;
        margin: 0;
    }

    .stockpack-generate-model {
        margin: 0;
    }

    .stockpack-generate-button {
        flex: 0 0 auto;
    }

    .stockpack-generate-cost {
        flex: 0 0 auto;
        font-size: 12px;
        color: #646970;
        white-space: nowrap;
        cursor: help;
    }

    .stockpack-generate-clear {
        flex: 0 0 auto;
        display: none;
        font-size: 12px;
        cursor: pointer;
        white-space: nowrap;
    }

    .stockpack-generate-status {
        display: none;
        flex: 0 0 auto;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: #1d2327;
        white-space: nowrap;
    }

    .stockpack-generate-cost.is-unavailable {
        flex: 1 1 220px;
        white-space: normal;
        line-height: 1.3;
    }

    .stockpack-generate-balance {
        flex: 0 0 auto;
        display: none;
        font-size: 12px;
        color: #1d2327;
        white-space: nowrap;
    }

    .stockpack-generate-pulse {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #2271b1;
        animation: stockpack-pulse 1.1s ease-in-out infinite;
    }

    .stockpack-generate-refine-label {
        flex: 0 0 auto;
        display: none;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        white-space: nowrap;

        input {
            margin: 0;
        }
    }

    &.is-generating {
        .stockpack-generate-status {
            display: inline-flex;
        }

        .stockpack-generate-cost,
        .stockpack-generate-balance,
        .stockpack-generate-clear,
        .stockpack-generate-refine-label {
            display: none !important;
        }
    }
}

@keyframes stockpack-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.6); }
}

@media (prefers-reduced-motion: reduce) {
    .stockpack-generate .stockpack-generate-pulse {
        animation: none;
    }
}

.media-frame .stockpack-generate select,
.wp-admin .media-frame .stockpack-generate select,
.media-frame .stockpack-generate .stockpack-generate-button,
.wp-admin .media-frame .stockpack-generate .stockpack-generate-button,
.media-frame .stockpack-generate .stockpack-generate-prompt {
    height: 32px;
    min-height: 32px;
    line-height: 30px;
    box-sizing: border-box;
    font-size: 14px;
    margin: 0;
}
