.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.marketplace-intro,
.marketplace-section-heading,
.marketplace-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.marketplace-section-heading p,
.marketplace-product-details,
.marketplace-dialog-note {
    margin: 0;
    color: #bfc9dc;
}

.marketplace-intro .marketplace-owner-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.marketplace-intro #marketplace-owner-launch[hidden] {
    display: none;
}

.marketplace-creator-page #marketplace-creator-seller-tools {
    margin-top: 12px;
}

.marketplace-creator-page #marketplace-creator-sales-panel {
    margin-top: 12px;
}

.marketplace-creator-page .marketplace-creator-sales-results {
    overflow-x: auto;
}

.marketplace-creator-page .marketplace-creator-sales-results table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.marketplace-creator-page .marketplace-creator-sales-results caption {
    text-align: left;
}

.marketplace-creator-page .marketplace-creator-sales-results th,
.marketplace-creator-page .marketplace-creator-sales-results td {
    padding: 8px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.marketplace-category-grid .is-selected {
    outline: 2px solid #f0be58;
    outline-offset: 2px;
}

.marketplace-category-group {
    position: relative;
    display: inline-flex;
    gap: 4px;
}

.marketplace-category-toggle {
    min-width: 38px;
    padding-right: 10px;
    padding-left: 10px;
}

.marketplace-category-menu {
    position: absolute;
    z-index: 2;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    min-width: 150px;
    overflow: hidden;
    border: 1px solid #4a5c7c;
    border-radius: 8px;
    background: #172033;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.marketplace-category-menu[hidden],
.marketplace-submission-form label[hidden] {
    display: none;
}

.marketplace-category-menu button {
    padding: 10px 12px;
    color: #f8f8f2;
    text-align: left;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.marketplace-category-menu button:hover,
.marketplace-category-menu button:focus-visible {
    background: rgba(40, 118, 183, 0.45);
}

.marketplace-product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.marketplace-product,
.marketplace-empty-state {
    min-width: 0;
    padding: 16px;
    border: 1px solid #34435d;
    border-radius: 8px;
    background: rgba(13, 20, 33, 0.45);
}

.marketplace-product h3,
.marketplace-empty-state h3 {
    margin: 12px 0 8px;
}

.marketplace-product {
    position: relative;
}

.marketplace-product-title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
}

.marketplace-product-title-link:focus-visible::after {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.marketplace-product :is(a:not(.marketplace-product-title-link), button, input, select, textarea, summary) {
    position: relative;
    z-index: 1;
}

.marketplace-product-description {
    min-height: 3em;
    white-space: pre-line;
}

.marketplace-product-publication-author {
    margin: -4px 0 8px;
    color: #bfc9dc;
    font-size: 0.875rem;
}

.marketplace-product-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(300px, 100%);
    max-height: 300px;
    object-fit: contain;
}

.marketplace-price {
    margin: 12px 0;
    font-weight: 700;
}

.marketplace-unavailable-action {
    width: 100%;
    cursor: not-allowed;
    opacity: 0.7;
}

.marketplace-pagination {
    justify-content: center;
    margin-top: 20px;
}

.marketplace-page-status {
    min-width: 110px;
    text-align: center;
}

.marketplace-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 24px;
    overflow-y: auto;
    color: #f8f8f2;
    background: #172033;
    border: 1px solid #4a5c7c;
    border-radius: 10px;
}

.marketplace-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.marketplace-dialog-close-form {
    display: flex;
    justify-content: flex-end;
}

.marketplace-dialog-close {
    padding: 0 8px;
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.marketplace-dialog label {
    display: grid;
    gap: 6px;
    margin: 14px 0;
}

.marketplace-dialog input,
.marketplace-dialog textarea,
.marketplace-dialog select {
    width: 100%;
    box-sizing: border-box;
}

.marketplace-dialog fieldset {
    padding: 0;
    border: 0;
}

.marketplace-submission-page {
    max-width: 760px;
    margin-right: auto;
    margin-left: auto;
}

.marketplace-submission-form label {
    display: grid;
    gap: 6px;
    margin: 14px 0;
}

.marketplace-submission-form input,
.marketplace-submission-form textarea,
.marketplace-submission-form select {
    width: 100%;
    box-sizing: border-box;
}

.marketplace-submission-form fieldset {
    padding: 0;
    border: 0;
}

.marketplace-file-drop {
    display: grid;
    gap: 6px;
    margin: 14px 0 8px;
    padding: 24px;
    color: #dbe5f5;
    text-align: center;
    cursor: pointer;
    background: rgba(13, 20, 33, 0.45);
    border: 1px dashed #4a5c7c;
    border-radius: 8px;
}

.marketplace-file-drop:hover,
.marketplace-file-drop:focus-visible,
.marketplace-file-drop.is-dragging {
    border-color: #f0be58;
    outline: none;
    background: rgba(40, 118, 183, 0.22);
}

.marketplace-file-drop[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

.marketplace-file-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 14px 0;
    list-style: none;
}

.marketplace-file-list li,
.marketplace-file-status {
    color: #bfc9dc;
}

.marketplace-file-list li {
    padding: 10px 12px;
    border: 1px solid #34435d;
    border-radius: 6px;
    background: rgba(13, 20, 33, 0.45);
}

.marketplace-file-status.is-valid,
.marketplace-file-list .is-valid {
    color: #a7dfa1;
}

.marketplace-file-status.is-invalid,
.marketplace-file-list .is-invalid {
    color: #ffb2ab;
}

.marketplace-product-image-preview {
    display: block;
    width: 300px;
    height: 300px;
    max-width: 100%;
    margin: 14px auto 0;
    object-fit: contain;
    background: rgba(13, 20, 33, 0.45);
    border: 1px solid #34435d;
    border-radius: 8px;
}

.marketplace-character-count {
    margin: -8px 0 14px;
    color: #bfc9dc;
    font-size: 0.9rem;
    text-align: right;
}

.marketplace-product-page-preview {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #34435d;
}

.marketplace-product-page-shell {
    margin-top: 16px;
    padding: 20px;
    border: 1px solid #34435d;
    border-radius: 8px;
    background: rgba(13, 20, 33, 0.28);
}

.marketplace-product-page-shell > h3 {
    margin: 16px 0 8px;
}

.marketplace-product-page-preview-back {
    display: inline-flex;
    cursor: default;
    opacity: 0.72;
}

.marketplace-product-detail {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 24px;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #34435d;
    border-radius: 8px;
    background: rgba(13, 20, 33, 0.45);
}

.marketplace-product-detail-image {
    display: grid;
    width: min(300px, 100%);
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    background: rgba(13, 20, 33, 0.65);
    border: 1px solid #4a5c7c;
    border-radius: 8px;
}

.marketplace-product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.marketplace-product-detail-image-placeholder {
    padding: 16px;
    color: #bfc9dc;
    text-align: center;
}

.marketplace-product-detail-content h2,
.marketplace-product-detail-content h3,
.marketplace-product-detail-content h4 {
    margin: 8px 0;
}

.marketplace-product-detail-content .marketplace-unavailable-action {
    width: auto;
}

.marketplace-product-assets {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #34435d;
}

.marketplace-product-assets-grid-wrap {
    overflow-x: auto;
}

.marketplace-product-assets-grid {
    display: grid;
    grid-template-columns: repeat(10, 100px);
    gap: 14px;
    width: max-content;
    min-width: 100%;
    margin-top: 16px;
}

.marketplace-product-asset {
    min-width: 0;
}

.marketplace-product-asset img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: rgba(13, 20, 33, 0.65);
    border: 1px solid #4a5c7c;
    border-radius: 6px;
}

.marketplace-product-asset-name {
    max-width: 100px;
    margin: 2px 0 0;
    overflow: hidden;
    color: #bfc9dc;
    font-size: 0.75rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketplace-product-asset-preview {
    display: block;
    padding: 0;
    cursor: zoom-in;
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.marketplace-product-asset-preview:focus-visible {
    outline: 2px solid #f0be58;
    outline-offset: 3px;
}

.marketplace-product-preview-dialog {
    width: min(960px, calc(100vw - 32px));
    margin: auto;
    box-sizing: border-box;
}

.marketplace-product-preview-dialog > img {
    display: block;
    width: 100%;
    max-height: calc(100dvh - 180px);
    object-fit: contain;
}

.marketplace-product-preview-dialog > img[hidden] {
    display: none;
}

.marketplace-product-preview-dialog .marketplace-dialog-note {
    overflow-wrap: anywhere;
}

.marketplace-product-assets-sentinel {
    height: 1px;
}

@media (max-width: 1280px) {
    .marketplace-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .marketplace-intro,
    .marketplace-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .marketplace-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .marketplace-product-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .marketplace-product-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-pagination {
        flex-wrap: wrap;
    }

    .marketplace-category-menu {
        position: fixed;
        left: 16px;
        right: 16px;
        min-width: 0;
    }
}
