/* Reusable UI components: gallery, chat, forms. */



.gallery{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:var(--gallery-gap);
    width:100%;
    padding:2px;
    box-sizing:border-box;
}

.gallery-card{
    position:relative;
    overflow:hidden;
    user-select:none;
    touch-action:manipulation;
    display:flex;
    flex-direction:column;
}

.gallery-card:active{
    transform:scale(.98);
}

.gallery-image-container{
    flex:1 1 auto;
    width:100%;
    border:1px solid var(--border);
    box-shadow:var(--gallery-shadow);
    aspect-ratio:12 / 16;
    overflow:hidden;
    border:2px solid var(--overlay-medium);
    border-radius:10px;
    background:var(--surface2);
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:0;
    border-radius:var(--gallery-radius);
}

.gallery-image{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
    display:block;
    border:0;
    border-radius:10px;
}

.gallery-info{
    flex-shrink:0;
    padding:2px 3px;
    font-size:0.95em;
    text-align:center;
    pointer-events:none;
    background:var(--surface);
}

.gallery-subtitle{
    color:var(--text2);
}

.gallery-title{
    font-size:13px;
    font-weight:600;
    color:var(--text);
}

.gallery-placeholder{
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--gallery-bg);
    color:var(--gallery-placeholder);
    font-size:56px;
}

.gallery-add-plus{
    display:flex;
    align-items:center;
    justify-content:center;
    aspect-ratio:1;
    border-radius:var(--gallery-radius);
    background:var(--border);
    border:1px dashed var(--divider);
    box-shadow:var(--gallery-shadow);
    color:var(--text3);
    font-size:56px;
    font-weight:300;
    cursor:pointer;
    user-select:none;
    transition:.18s;
}

.gallery-add-plus:active{
    transform:scale(.98);
}

.gallery-photos{
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--surface2);
    color:var(--text3);
    font-size:56px;
    font-weight:300;
    user-select:none;
}

.chat-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:7px 7px;
    background:var(--surface);
    border-bottom:1px solid var(--gallery-border);
    cursor:pointer;
}

.chat-title{
    font-weight:600;
}

.chat-description{
    color:darkgray;
}

.chat-item:active{
    background:var(--pressed-bg);
}

.chat-avatar-count{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:2.2em;
    height:2.2em;
    font-weight:700;
    font-size:1.2em;
    border:2px solid var(--divider);
    border-radius:50%;
    color:var(--text2);
    background:var(--surface2);
}

.chat-item.empty-record{
    color:var(--text3);
}

.chat-item.empty-record .chat-title,
.chat-item.empty-record .chat-description,
.chat-item.empty-record .chat-record-count,
.chat-item.empty-record .chat-avatar-count{
    color:var(--text3);
}

.field-row{
    display:flex;
    align-items:center;
    gap:10px;
    margin:1px 10px 1px 0;
}

.field-label{
    flex:0 0 25%;
    text-align:right;
    font-weight:600;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.field-row input,
.field-row select,
.field-row textarea{
    flex:1;
    min-width:0;
    font:inherit;
    box-sizing:border-box;
}

.field-row textarea{
    resize:vertical;
    min-height:72px;
}
