.ac-attachments {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0;
}

.ac-image-attachment {
    margin: 0;
    max-width: min(320px, 100%);
    border: 1px solid rgba(128,128,128,.22);
    border-radius: 10px;
    overflow: hidden;
}

.ac-image-preview {
    position: relative;
    display: block;
    background: rgba(128,128,128,.06);
    cursor: zoom-in;
}

.ac-image-preview img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.ac-image-expand {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,.65);
    color: white;
    border-radius: 6px;
    opacity: .8;
}

.ac-image-preview:hover .ac-image-expand {
    opacity: 1;
}

.ac-image-attachment figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    font-size: 12px;
}

.ac-image-attachment figcaption span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-image-attachment figcaption a {
    flex-shrink: 0;
    color: inherit;
}

.ac-image-attachment svg,
.ac-lightbox-actions svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#ac-image-lightbox {
    position: fixed;
    inset: 0;
    width: min(1200px, 96vw);
    max-width: 96vw;
    max-height: 94dvh;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #111318;
    color: #fff;
    overflow: hidden;
}

#ac-image-lightbox:not([open]) {
    display: none;
}

#ac-image-lightbox::backdrop {
    background: rgba(0,0,0,.88);
}

.ac-lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    background: #1b1e25;
    font-size: 13px;
}

.ac-lightbox-toolbar > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-lightbox-actions {
    display: flex;
    gap: 10px;
}

.ac-lightbox-actions a,
.ac-lightbox-actions button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: white;
    background: rgba(255,255,255,.08);
    cursor: pointer;
}

.ac-lightbox-actions a:hover,
.ac-lightbox-actions button:hover {
    background: rgba(255,255,255,.18);
}

.ac-lightbox-stage {
    display: grid;
    place-items: center;
    padding: 12px;
    overflow: auto;
}

.ac-lightbox-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(94dvh - 80px);
    object-fit: contain;
}

body:has(#ac-image-lightbox[open]) {
    overflow: hidden;
}
