.fotos-editor {
    background: var(--cor-superficie, #fff);
    border: 1px solid #dbe4ef;
    border-radius: 22px;
    padding: clamp(18px, 3vw, 32px);
    margin: 28px 0;
}

.fotos-cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.fotos-cabecalho h2 {
    font-size: 1.4rem;
    margin: 8px 0;
    color: #14213d;
}

.fotos-cabecalho p,
.fotos-ajuda {
    color: #52627a;
    line-height: 1.6;
}

.fotos-contagem,
.foto-posicao {
    background: #edf2f8;
    color: #14213d;
    border-radius: 20px;
    padding: 8px 12px;
    font-weight: 700;
    white-space: nowrap;
}

.fotos-vazio {
    display: grid;
    justify-items: center;
    gap: 12px;
    text-align: center;
    background: #f5f7fa;
    border-radius: 16px;
    padding: 32px 20px;
}

.fotos-grade,
.galeria-publica {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 20px;
    margin: 20px 0;
}

.foto-cartao {
    min-width: 0;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    overflow: hidden;
    background: white;
}

.foto-cartao img,
.galeria-publica img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.foto-conteudo {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.foto-conteudo form,
.fotos-upload {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.foto-conteudo label {
    font-weight: 600;
    font-size: .9rem;
}

.foto-ordem {
    border: 1px solid #cbd6e6;
    border-radius: 10px;
    min-height: 44px;
    padding: 10px;
    background: white;
    color: #14213d;
}

.foto-remover {
    color: #a32923;
}

.fotos-upload {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #dbe4ef;
}

.seletor-fotos {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    border: 1px dashed #a9b8cd;
    border-radius: 16px;
    padding: 20px;
    background: #f8fafc;
    min-width: 0;
}

.fotos-escolher {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #14213d;
    font-weight: 700;
    cursor: pointer;
}

.seletor-fotos input[type="file"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
    min-height: 44px;
}

.seletor-fotos small {
    line-height: 1.6;
    color: #52627a;
}

.fotos-validacao {
    color: #a32923;
    margin: 0;
}

.fotos-validacao:empty,
.fotos-previa:empty {
    display: none;
}

.fotos-previa {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 12px;
}

.fotos-previa figure {
    margin: 0;
    min-width: 0;
}

.fotos-previa img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 12px;
}

.fotos-previa figcaption {
    overflow-wrap: anywhere;
    font-size: .8rem;
    margin-top: 6px;
}

.fotos-perfil {
    max-width: 320px;
}

.fotos-perfil img {
    height: 220px;
    object-fit: contain;
    background: #f5f7fa;
}

.galeria-publica a {
    overflow: hidden;
    border-radius: 14px;
    background: #edf2f8;
    color: #14213d;
    text-decoration: none;
}

.galeria-publica span {
    display: block;
    padding: 12px;
    overflow-wrap: anywhere;
}

.galeria-capa {
    margin: 0;
    display: block;
}

.galeria-capa a {
    display: block;
    border-radius: 0;
}

.galeria-capa + .sede-capa,
.galeria-capa ~ .busca-cartao-quadra {
    display: none;
}

.fotos-instalacoes {
    padding: 18px;
    margin: 20px 0;
    background: white;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
}

.fotos-instalacoes summary {
    cursor: pointer;
    font-weight: 700;
    min-height: 32px;
}

@media (max-width: 520px) {
    .fotos-cabecalho {
        flex-wrap: wrap;
    }

    .fotos-grade {
        grid-template-columns: 1fr;
    }

    .galeria-publica:not(.galeria-capa) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .galeria-publica:not(.galeria-capa) img {
        height: 120px;
    }

    .foto-conteudo .mud-button,
    .fotos-upload .mud-button {
        width: 100%;
    }
}
