/* 一覧サムネイル（画像・動画・音声・ファイル共通の枠サイズ） */
.dm-mgmt-media-thumb {
    --dm-media-thumb-size: 9rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--dm-media-thumb-size);
    height: var(--dm-media-thumb-size);
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-light);
    color: var(--text-color);
    font: inherit;
}

.dm-mgmt-media-thumb:hover {
    border-color: var(--primary-color);
}

.dm-mgmt-media-thumb:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.dm-mgmt-media-thumb__visual {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.dm-mgmt-media-thumb--video .dm-mgmt-media-thumb__play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(38, 38, 38, 0.72);
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 2.25rem;
    text-align: center;
    pointer-events: none;
}

.dm-mgmt-media-thumb--audio .dm-mgmt-media-thumb__audio {
    width: calc(100% - 1rem);
    max-width: 8rem;
    pointer-events: none;
}

.dm-mgmt-media-thumb--file .dm-mgmt-media-thumb__file-label {
    margin: 0;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
    color: var(--primary-color);
    pointer-events: none;
}

.dm-mgmt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dm-mgmt-lightbox.is-open {
    display: flex;
}

.dm-mgmt-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.dm-mgmt-lightbox__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(920px, 100%);
    max-height: min(90vh, 720px);
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

.dm-mgmt-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.dm-mgmt-lightbox__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.dm-mgmt-lightbox__close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.dm-mgmt-lightbox__close:hover {
    background: #ffebee;
    color: var(--error-color);
}

.dm-mgmt-lightbox__close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.dm-mgmt-lightbox__body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    max-height: calc(min(90vh, 720px) - 3rem);
    padding: 1rem;
    background: var(--bg-light);
    overflow: auto;
}

.dm-mgmt-lightbox__image,
.dm-mgmt-lightbox__video {
    max-width: 100%;
    max-height: calc(min(90vh, 720px) - 5rem);
    border-radius: 8px;
}

.dm-mgmt-lightbox__video {
    width: 100%;
    background: #262626;
}

.dm-mgmt-lightbox__audio {
    width: min(100%, 28rem);
}

.dm-mgmt-lightbox__file-actions {
    margin: 0;
    text-align: center;
}

.dm-mgmt-compose {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.dm-mgmt-compose-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: inherit;
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-color);
}

.dm-mgmt-compose-textarea:disabled {
    cursor: not-allowed;
    opacity: 0.85;
    color: var(--text-light);
}

.dm-mgmt-compose-feedback {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

.dm-mgmt-compose-feedback.is-error {
    color: var(--error-color);
}

.dm-mgmt-compose-feedback.is-success {
    color: #2e7d32;
}

.dm-mgmt-compose-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.dm-mgmt-compose-note {
    margin: 0;
    flex: 1 1 12rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.dm-mgmt-compose-note--warning {
    color: var(--error-color);
}

.dm-mgmt-empty-hint {
    margin: 0;
    padding: 1rem 0.85rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

@media (min-width: 901px) {
    .dm-management-page .dm-mgmt-panels {
        height: calc(100dvh - 14rem);
        max-height: calc(100dvh - 14rem);
    }
}

@media (max-width: 900px) {
    .dm-mgmt-panels {
        flex-direction: column;
        min-height: 20rem;
        max-height: calc(100dvh - 12rem);
    }

    .dm-mgmt-thread-panel {
        flex: 0 0 auto;
        max-width: none;
        max-height: 14rem;
    }

    .dm-mgmt-message-panel {
        flex: 1 1 auto;
        min-height: 16rem;
    }
}

