.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.photo-grid a {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.375rem;
    background: #f8f9fa;
}

.photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.photo-grid a:hover img {
    transform: scale(1.03);
}

.photo-detail-wrap {
    display: inline-block;
    max-width: 100%;
}

.photo-detail-wrap img {
    display: block;
}

.face-box {
    position: absolute;
    border: 2px solid rgba(13, 110, 253, 0.85);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.face-box--unnamed {
    pointer-events: auto;
    cursor: pointer;
    text-decoration: none;
}

.face-box--unnamed:hover {
    border-color: rgba(73, 80, 87, 0.95);
}

.face-box__label {
    position: absolute;
    left: -2px;
    bottom: 100%;
    margin-bottom: 2px;
    max-width: min(12rem, 200%);
    padding: 0.1rem 0.4rem;
    border-radius: 0.2rem;
    background: rgba(13, 110, 253, 0.92);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.face-box__label--unnamed {
    background: rgba(108, 117, 125, 0.92);
}

.face-box--unnamed:hover .face-box__label--unnamed {
    background: rgba(73, 80, 87, 0.95);
    color: #fff;
}

.cluster-actions--highlight {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    background: rgba(13, 110, 253, 0.06);
}
