.niw-custom-stamp-order {
    max-width: 1180px;
    margin: 0 auto;
}

.niw-stamp-loading,
.niw-stamp-notice,
.niw-stamp-header,
.niw-stamp-steps,
.niw-custom-stamp-order [data-step-panel] {
    box-sizing: border-box;
}

.niw-stamp-loading,
.niw-stamp-notice,
.niw-custom-stamp-order [data-step-panel] {
    padding: 24px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
}

.niw-stamp-header {
    margin-bottom: 20px;
}

.niw-stamp-header h2,
.niw-stamp-section-heading h3,
.niw-stamp-item-heading h4,
.niw-stamp-editor-heading h4,
.niw-stamp-review-card h4 {
    margin: 0;
}

.niw-stamp-header p,
.niw-stamp-section-heading p,
.niw-stamp-review-card p {
    margin: 8px 0 0;
}

.niw-stamp-kicker,
.niw-stamp-step-label {
    margin: 0 0 6px !important;
    color: #646970;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.niw-stamp-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.niw-stamp-steps button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 8px 12px;
    background: #f4f4f4;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    color: inherit;
    font-weight: 700;
}

.niw-stamp-steps button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #ffffff;
}

.niw-stamp-steps button.is-active {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

.niw-stamp-steps button.is-active span {
    color: #000000;
}

.niw-stamp-steps button:disabled:not(.is-active) {
    opacity: 0.55;
}

.niw-stamp-notice {
    margin-bottom: 20px;
}

.niw-stamp-notice.is-success {
    border-left: 4px solid #00a32a;
}

.niw-stamp-notice.is-error {
    border-left: 4px solid #d63638;
}

.niw-stamp-section-heading,
.niw-stamp-actions,
.niw-stamp-review-card,
.niw-stamp-review-summary,
.niw-stamp-item-heading,
.niw-stamp-editor-actions,
.niw-stamp-item-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.niw-stamp-section-heading {
    align-items: flex-start;
    margin-bottom: 20px;
}

.niw-stamp-design-count {
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(102, 51, 153, 0.08);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.niw-stamp-order-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
    gap: 24px;
    align-items: start;
}

.niw-stamp-items-panel {
    min-width: 0;
}

.niw-stamp-empty {
    padding: 20px;
    border: 1px dashed rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    color: #646970;
    text-align: center;
}

.niw-stamp-item-list {
    display: grid;
    gap: 12px;
}

.niw-stamp-item-card,
.niw-stamp-review-card {
    padding: 16px;
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

.niw-stamp-item-heading > div:first-child,
.niw-stamp-item-actions {
    display: flex;
    align-items: center;
}

.niw-stamp-item-heading > div:first-child {
    min-width: 0;
    gap: 9px;
}

.niw-stamp-item-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1d2327;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
}

.niw-stamp-item-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.niw-stamp-item-details {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 5px 12px;
    margin: 14px 0 0;
    font-size: 0.9rem;
}

.niw-stamp-item-details dt {
    color: #646970;
    font-weight: 700;
}

.niw-stamp-item-details dd {
    margin: 0;
}

.niw-stamp-item-notes-summary {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: rgba(102, 51, 153, 0.08);
    white-space: pre-wrap;
}

.niw-stamp-item-editor {
    position: sticky;
    top: 18px;
    padding: 20px;
    background: rgba(102, 51, 153, 0.06);
    border: 1px solid rgba(102, 51, 153, 0.22);
    border-radius: 10px;
}

.admin-bar .niw-stamp-item-editor {
    top: 50px;
}

.niw-stamp-editor-heading {
    margin-bottom: 18px;
}

.niw-stamp-editor-heading p {
    margin: 4px 0 0;
    color: #646970;
    font-size: 0.84rem;
}

.niw-stamp-field,
.niw-stamp-size-field,
.niw-stamp-item-notes {
    display: grid;
    gap: 7px;
    margin: 0 0 18px;
}

.niw-stamp-field > span,
.niw-stamp-size-field > span,
.niw-stamp-item-notes > span {
    font-weight: 700;
}

.niw-stamp-field input,
.niw-stamp-field select,
.niw-stamp-field textarea,
.niw-stamp-item-notes textarea {
    width: 100%;
    box-sizing: border-box;
}

.niw-stamp-field small {
    color: #646970;
}

.niw-stamp-additional-sizes {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.niw-stamp-empty-sizes {
    margin: 0;
    color: #646970;
}

.niw-stamp-slider-label,
.niw-stamp-range-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.niw-stamp-slider-label output {
    min-width: 62px;
    padding: 4px 8px;
    background: rgba(102, 51, 153, 0.08);
    border-radius: 999px;
    font-weight: 700;
    text-align: center;
}

.niw-stamp-range {
    width: 100%;
    margin: 4px 0 0;
}

.niw-stamp-range-scale {
    color: #646970;
    font-size: 0.78rem;
}

.niw-stamp-item-price {
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.niw-stamp-item-price strong {
    font-size: 1.1rem;
}

.niw-stamp-editor-actions {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 18px;
}

.niw-stamp-editor-actions .description {
    max-width: 420px;
    margin: 8px 0 0;
}

.niw-stamp-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.niw-stamp-actions.is-end {
    justify-content: flex-end;
}

.niw-stamp-upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.niw-stamp-dropzone {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    min-height: 190px;
    padding: 24px;
    border: 2px dashed rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
}

.niw-stamp-dropzone.is-dragging {
    border-color: #6b3b8f;
    background: rgba(102, 51, 153, 0.06);
}

.niw-stamp-reference-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.niw-stamp-reference-image {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #ffffff;
}

.niw-stamp-reference-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}

.niw-stamp-reference-image figcaption {
    overflow-wrap: anywhere;
    font-size: 0.82rem;
}

.niw-stamp-review-card {
    margin-top: 18px;
}

.niw-stamp-review-summary {
    margin-top: 20px;
    padding: 18px;
    background: rgba(102, 51, 153, 0.06);
    border-radius: 10px;
}

.niw-stamp-review-summary > div {
    display: grid;
    gap: 4px;
}

.niw-stamp-review-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.niw-stamp-group-manager {
    margin: 0 0 24px;
    padding: 18px;
    border: 1px solid rgba(102, 51, 153, 0.22);
    border-radius: 10px;
    background: #ffffff;
}

.niw-stamp-group-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.niw-stamp-group-list .button.is-current {
    border-color: #663399;
    box-shadow: 0 0 0 1px #663399;
}

@media (max-width: 900px) {
    .niw-stamp-order-layout {
        grid-template-columns: 1fr;
    }

    .niw-stamp-item-editor {
        position: static;
    }
}

@media (max-width: 600px) {
    .niw-stamp-loading,
    .niw-stamp-notice,
    .niw-custom-stamp-order [data-step-panel] {
        padding: 18px;
    }

    .niw-stamp-steps {
        grid-template-columns: 1fr;
    }

    .niw-stamp-section-heading,
    .niw-stamp-actions,
    .niw-stamp-review-card,
    .niw-stamp-review-summary,
    .niw-stamp-item-heading,
    .niw-stamp-editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .niw-stamp-actions .button,
    .niw-stamp-review-actions .button {
        width: 100%;
        text-align: center;
    }

    .niw-stamp-item-actions {
        justify-content: flex-start;
    }
}
