/*
 * Split from chat.css.
 * Do not patch-stack random chat styles here.
 * Keep selectors grouped by purpose.
 */

.attachment-preview {
    display: block;
    overflow: hidden;
    border-radius: 16px;
}

button.attachment-preview {
    width: 100%;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    text-align: inherit;
}

.image-preview img,
.video-preview video {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 16px;
}

.video-preview video {
    background: #000000;
}

.attachment-file {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 10px;
    align-items: center;
    min-width: 210px;
    padding: 10px;
    border-radius: 16px;
    color: inherit;
    background: rgba(127, 195, 255, 0.14);
    text-decoration: none;
}

.attachment-file i {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--icon);
    background: var(--surface-soft);
}

.attachment-file strong,
.attachment-file small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-file small {
    margin-top: 3px;
    opacity: 0.76;
}

.attachment-caption {
    margin-top: 8px;
}

.attachment-location {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    min-width: 220px;
    padding: 12px;
    border-radius: 18px;
    color: inherit;
    background: rgba(127, 195, 255, 0.14);
    text-decoration: none;
}

.attachment-location i {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--button-gradient);
}

.attachment-location strong,
.attachment-location small {
    display: block;
}

.attachment-location small {
    margin-top: 3px;
    opacity: 0.78;
}

.attachment-voice {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    min-width: 250px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(127, 195, 255, 0.14);
}

.attachment-voice audio {
    display: none;
}

.upload-progress-panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
}

.upload-progress-panel[hidden] {
    display: none;
}

.upload-progress-copy {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.upload-progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(127, 195, 255, 0.16);
}

.upload-progress-track i {
    width: 0%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--button-gradient);
    transition: width 140ms ease;
}

.chat-media-viewer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    grid-template-rows: auto 1fr;
    background: rgba(0, 0, 0, 0.92);
}

.chat-media-viewer.is-hidden {
    display: none;
}

.chat-media-viewer-toolbar {
    min-width: 0;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.34);
}

.chat-media-viewer-toolbar strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.chat-media-viewer-toolbar span {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-media-viewer-toolbar a,
.chat-media-viewer-toolbar button {
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
}

.chat-media-viewer-toolbar a {
    padding: 0 12px;
}

.chat-media-viewer-toolbar button {
    width: 36px;
}

.chat-media-viewer-stage {
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 12px;
    overflow: auto;
}

.chat-media-viewer-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}
