.fab-gallery-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    width: 100%;
    margin: 0.35rem 0 1.25rem;
}

.fab-gallery-item {
    border: 1px solid var(--card-border);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    height: clamp(120px, 18vw, 150px);
}

.fab-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    cursor: zoom-in;
}

.fab-gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 18, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    z-index: 2000;
    cursor: zoom-out;
}

.fab-gallery-overlay.is-visible {
    display: flex;
}

.fab-gallery-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    cursor: zoom-out;
}

.fab-gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 0.75rem;
}

.fab-gallery-slot {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 0;
    border-radius: 16px;
    background: transparent;
}

.fab-gallery-media {
    position: relative;
    width: 100%;
}

.fab-gallery-slot img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.03);
    display: block;
}

.fab-gallery-preview.is-hidden {
    display: none !important;
}

.fab-gallery-media .icon-button img {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.fab-gallery-empty {
    height: 90px;
    border-radius: 12px;
    border: 1px dashed var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.fab-gallery-empty.is-hidden {
    display: none !important;
}

.fab-gallery-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.fab-gallery-upload {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    border-radius: 9px;
    line-height: 0;
}

.fab-gallery-upload.icon-button,
.fab-gallery-upload.icon-button:hover,
.fab-gallery-upload.icon-button:focus-visible,
.fab-gallery-upload.icon-button:active {
    background: var(--bg);
    border: 0;
    box-shadow: 0 0 0 1px var(--card-border), 0 6px 16px rgba(0, 0, 0, 0.35);
    color: var(--text);
}

.fab-gallery-upload input {
    display: none;
}

.fab-gallery-upload img {
    width: 14px;
    height: 14px;
    display: block;
}

.fab-gallery-remove {
    width: 28px;
    height: 28px;
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    border-radius: 9px;
    border: 0;
    box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.fab-gallery-remove.icon-button.danger {
    background: var(--bg);
}

.fab-gallery-remove.icon-button.danger:hover,
.fab-gallery-remove.icon-button.danger:focus-visible {
    background: var(--bg);
}

.fab-gallery-remove.is-hidden {
    display: none !important;
}

.fab-gallery-remove img {
    width: 14px;
    height: 14px;
}

@media (max-width: 1100px) {
    .fab-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 720px) {
    .fab-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}
