.dh-prompt {
    background: var(--surface);
    color: var(--ink);
}

.dh-prompt-detail {
    padding-block: clamp(24px, 5vw, 64px);
}

.dh-prompt-detail h1 {
    margin: 12px 0 24px;
    font-size: clamp(1.9rem, 4vw, 3.25rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.dh-prompt-back {
    color: var(--accent);
    font-weight: 650;
}

.dh-prompt-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(16px, 3vw, 32px);
}

.dh-prompt-grid--text {
    grid-template-columns: minmax(0, 760px);
}

.dh-prompt-cover {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 18px;
    background: var(--deep);
}

.dh-prompt-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
}

.dh-prompt-panel,
.dh-prompt-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
}

.dh-prompt-panel {
    padding: clamp(16px, 3vw, 24px);
}

.dh-prompt-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dh-prompt-panel h2,
.dh-prompt-attachments h2 {
    margin: 0;
    font-size: 1.2rem;
}

.dh-prompt-copy {
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-weight: 650;
    line-height: 1.4;
    font-size: .875rem;
    cursor: pointer;
}

.dh-prompt-copy[hidden],
.dh-prompt-expand[hidden] {
    display: none;
}

.dh-prompt #dh-prompt-text {
    margin: 0;
    padding: 16px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.dh-prompt #dh-prompt-text.dh-prompt-text--collapsed {
    box-sizing: border-box;
    max-height: 15rem;
    max-height: calc(8lh + 32px);
    overflow: clip;
}

.dh-prompt-expand {
    margin: 12px 0 0;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: #493394;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.dh-prompt-attachments {
    margin-top: 20px;
}

.dh-prompt-attachments > div,
.dh-prompt-library {
    display: grid;
    gap: 14px;
}

.dh-prompt-attachments > div {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    margin-top: 10px;
}

.dh-prompt-library {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.dh-prompt-attachments img,
.dh-prompt-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--line);
}

.dh-prompt-card--banner img {
    aspect-ratio: 2 / 1;
    object-fit: contain;
}

.dh-prompt-attachments img {
    border-radius: 8px;
}

.dh-prompt-card {
    text-decoration: none;
}

.dh-prompt-card :is(h2, h3) {
    margin: 0;
    padding: 14px 16px;
    font-size: 1.1rem;
}

.dh-prompt-info {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.dh-prompt-description {
    min-width: 0;
    padding: 18px clamp(16px, 3vw, 24px);
    overflow-x: auto;
    border: 1px solid #e3dff4;
    border-inline-start: 3px solid #8b74dc;
    border-radius: 12px;
    background: #f1eefb;
}

.dh-prompt-description > h2 {
    margin: 0 0 8px;
    color: #322458;
    font-size: 1rem;
    line-height: 1.35;
}

.dh-prompt-description .dh-prose {
    color: #3f3852;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.dh-prompt-description .dh-prose > :first-child {
    margin-top: 0;
}

.dh-prompt-description .dh-prose > :last-child {
    margin-bottom: 0;
}

.dh-prompt-author {
    max-width: 680px;
    margin-top: 28px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow-wrap: anywhere;
}

.dh-prompt-author h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.dh-prompt-author p {
    margin: 0;
}

.dh-prompt-author p + p {
    margin-top: 6px;
    color: var(--muted);
}

.dh-library--home {
    padding-top: clamp(16px, 3vw, 40px);
    background: #f8f9fc;
}

.dh-library-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: clamp(390px, 41vw, 510px);
    overflow: hidden;
    border-radius: 24px;
    background: #14191a;
    color: #fff;
}

.dh-library-intro {
    position: relative;
    width: min(57%, 620px);
    box-sizing: border-box;
    padding: clamp(28px, 5vw, 68px);
}

.dh-library-intro h1 {
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(2.5rem, 5.4vw, 4.75rem);
    font-weight: 750;
    line-height: 1.04;
    letter-spacing: -.058em;
    text-wrap: balance;
    text-align: left;
}

.dh-library-intro p {
    margin: 0 0 24px;
    color: #e4e6e3;
    font-size: 1.06rem;
}

.dh-library-search button {
    display: inline-block;
    margin: 0;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #5639bb;
    color: #fff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.dh-library-search button:hover {
    color: #fff;
    background: #452a9b;
}

.dh-library-feature {
    position: absolute;
    z-index: -1;
    inset: 0 0 0 30%;
    overflow: hidden;
    margin: 0;
}

.dh-library-feature::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #14191a 0%, #14191ae8 13%, #14191a40 51%, transparent 78%);
    content: '';
}

.dh-library-feature img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 55%;
}

.dh-library-feature figcaption {
    position: absolute;
    z-index: 1;
    right: 20px;
    bottom: 16px;
    max-width: calc(100% - 40px);
    padding: 5px 10px;
    border-radius: 6px;
    background: #14191add;
    color: #fff;
    font-size: .8125rem;
    text-align: right;
}

.dh-library-intro .dh-library-search {
    width: min(100%, 410px);
    box-sizing: border-box;
    padding: 4px;
    border-radius: 12px;
    background: #fff;
}

.dh-library-intro .dh-library-search input[type="search"] {
    border-color: transparent;
}

.dh-library-intro .dh-library-search button {
    padding: 8px 14px;
    background: #3d2b90;
}

.dh-library-intro .dh-library-search button:hover {
    background: #2d2068;
}

.dh-home-collections {
    padding-block: clamp(24px, 4vw, 52px);
}

.dh-home-collection-nav {
    margin: 0;
    padding-bottom: clamp(18px, 3vw, 28px);
}

.dh-home-collection {
    scroll-margin-top: 24px;
}

.dh-home-collection + .dh-home-collection {
    margin-top: clamp(28px, 5vw, 56px);
    padding-top: clamp(24px, 4vw, 44px);
    border-top: 1px solid var(--line);
}

.dh-home-collection > h2 {
    margin: 0 0 20px;
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.dh-home-read-more {
    display: inline-flex;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
    margin-top: 20px;
    padding: 7px 17px;
    border: 1px solid #cfc1f3;
    border-radius: 10px;
    background: #fff;
    color: #432d93;
    font-size: .95rem;
    font-weight: 650;
    text-decoration: none;
}

.dh-home-read-more:hover {
    border-color: #a895de;
    background: #f0eafe;
    color: #321e79;
}

.dh-library--home .dh-prompt-library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 24px);
}

.dh-library-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
}

.dh-library-heading :is(h1, h2) {
    margin: 0;
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.dh-library-search {
    display: flex;
    width: min(100%, 390px);
    align-items: center;
    gap: 8px;
    margin: 0;
}

.dh-library-search input[type="search"] {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.dh-library-search button {
    flex: none;
}

.dh-library-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0;
}

.dh-library-collections + .dh-library-topics {
    margin-top: -12px;
}

.dh-library-topics a {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.dh-library-topics a:is([aria-current="page"], :hover) {
    border-color: #d7ccf7;
    background: #eae3ff;
    color: #392381;
}

.dh-prompt-card:hover {
    border-color: #826cce;
}

.dh-prompt-card-topic {
    display: block;
    padding: 12px 16px 0;
    color: #5639a2;
    font-size: .875rem;
    font-weight: 650;
}

.dh-prompt-card-topic + :is(h2, h3) {
    padding-top: 4px;
}

.dh-library-all {
    display: inline-block;
    margin-top: 20px;
    color: #432d93;
    font-weight: 650;
}

.dh-library-empty {
    margin: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
}

@media (max-width: 760px) {
    .dh-prompt-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dh-library-hero {
        min-height: 0;
        border-radius: 18px;
    }

    .dh-library-intro {
        width: auto;
        padding: clamp(20px, 5vw, 38px);
    }

    .dh-library-intro h1 {
        max-width: 12ch;
        text-wrap: initial;
    }

    .dh-library-feature {
        position: relative;
        z-index: 0;
        inset: auto;
        grid-row: 2;
    }

    .dh-library-feature::after {
        display: none;
    }

    .dh-library-feature img {
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .dh-library-feature figcaption {
        right: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }

    .dh-library--home .dh-prompt-library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .dh-library--home .dh-prompt-library {
        grid-template-columns: minmax(0, 1fr);
    }
}
