#custom-prompt-container {
    margin-top: 12rem;
}

.custom-prompt-page {
    width: 100%;
}

.custom-prompt-page__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 1rem;
    width: calc(100% - 1rem);
    max-width: 960px;
    margin: 0 auto;
}

.custom-prompt-breadcrumb {
    padding: 0 0 0.45rem;
    font-size: 0.72rem;
    line-height: 1.5;
}

.custom-prompt-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.custom-prompt-breadcrumb li {
    min-width: 0;
    color: #666;
}

.custom-prompt-breadcrumb li:not(:last-child)::after {
    content: ">";
    margin-left: 0.25rem;
    color: #999;
}

.custom-prompt-breadcrumb a {
    color: #777;
    text-decoration: none;
}

.custom-prompt-breadcrumb [aria-current="page"] {
    overflow: hidden;
    max-width: 100%;
    padding: 0 0.35rem;
    background-color: #fff200;
    color: #333;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-prompt-detail {
    grid-column: 1;
    margin-top: 2rem;
    padding: 2rem;
    background-color: #d9d9d9;
}

.custom-prompt-detail__heading {
    margin: 0 0 1.5rem;
    font-size: clamp(1.35rem, 4vw, 2.2rem);
    line-height: 1.4;
    text-align: center;
}

.custom-prompt-detail__content {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: clamp(1.2rem, 4vw, 2rem);
    align-items: start;
}

.custom-prompt-detail__content--with-extra-images {
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
}

.custom-prompt-detail__media {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.custom-prompt-detail__image {
    margin: 0;
    background-color: #fff;
}

.custom-prompt-detail__image a {
    display: block;
    cursor: zoom-in;
}

.custom-prompt-detail__image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.custom-prompt-detail__extra-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    min-width: 0;
}

.custom-prompt-detail__extra-image {
    margin: 0;
    background-color: #fff;
}

.custom-prompt-detail__extra-image a {
    display: block;
    cursor: zoom-in;
}

.custom-prompt-detail__extra-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.custom-prompt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.78);
}

.custom-prompt-lightbox__body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(92vw, 1100px);
    max-height: 92vh;
}

.custom-prompt-lightbox__image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    background-color: #fff;
}

.custom-prompt-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #fff;
    border-radius: 0;
    background-color: #000;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.custom-prompt-lightbox__close-text {
    margin-top: 0.8rem;
    padding: 0.45rem 1.2rem;
    border: 1px solid #fff;
    border-radius: 0;
    background-color: #000;
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.custom-prompt-detail__prompt {
    min-width: 0;
    background-color: #fff;
}

.custom-prompt-detail__prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px dashed #999;
}

.custom-prompt-detail__prompt-header h2 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.custom-prompt-copy {
    flex: 0 0 auto;
    min-width: 5.5rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid #000;
    border-radius: 0;
    background-color: #fff875;
    color: #000;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.custom-prompt-copy.is-copied {
    background-color: #000;
    color: #fff;
}

.custom-prompt-detail__prompt-text {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.9;
    white-space: pre-wrap;
}

.custom-prompt-detail__prompt-text > *:first-child {
    margin-top: 0;
}

.custom-prompt-detail__prompt-text > *:last-child {
    margin-bottom: 0;
}

.custom-prompt-detail__copy-source {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: pre;
}

.custom-prompt-detail__back {
    margin: 1.3rem 0 0;
    text-align: right;
}

.custom-prompt-detail__back a {
    color: #000;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.custom-prompt-sidebar {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.custom-prompt-sidebar .single-sidebar__empty {
    color: #666;
    font-size: 0.68rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    #custom-prompt-container {
        margin-top: 7rem;
    }

    .custom-prompt-detail {
        grid-column: auto;
        padding: 1.2rem;
    }

    .custom-prompt-page__inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .custom-prompt-detail__content {
        grid-template-columns: 1fr;
    }

    .custom-prompt-detail__content--with-extra-images {
        grid-template-columns: 1fr;
    }

    .custom-prompt-detail__media {
        gap: 0.75rem;
    }

    .custom-prompt-detail__extra-images {
        display: flex;
        gap: 0.75rem;
        margin-right: -1.2rem;
        padding: 0 1.2rem 0.25rem 0;
        overflow-x: auto;
        scroll-padding-right: 1.2rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .custom-prompt-detail__extra-images::-webkit-scrollbar {
        display: none;
    }

    .custom-prompt-detail__extra-image {
        flex: 0 0 min(44vw, 160px);
        scroll-snap-align: start;
    }

    .custom-prompt-sidebar {
        grid-column: auto;
        grid-row: auto;
    }
}
