/* Broadcast message compose + global popup */

.broadcast-compose-fields {
    display: grid;
    gap: 0.85rem;
}

.broadcast-empty {
    padding: 0.75rem 0.15rem;
    color: #64748b;
    font-size: 0.88rem;
}

.broadcast-history {
    display: grid;
    gap: 0.45rem;
}

.broadcast-history-item {
    border: 1px solid rgba(15, 78, 107, 0.1);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    background: #fff;
}

.broadcast-history-item.is-active {
    border-color: rgba(15, 78, 107, 0.28);
    box-shadow: inset 2px 0 0 var(--brand-primary, #0F4E6B);
}

.broadcast-history-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.broadcast-history-item__head strong {
    display: block;
    color: #0f172a;
    font-size: 0.86rem;
    margin-bottom: 0.1rem;
    line-height: 1.35;
}

.broadcast-history-item__meta {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.3;
}

.broadcast-history-item__badges {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.broadcast-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    background: #e2e8f0;
    color: #475569;
}

.broadcast-badge--active {
    background: rgba(15, 78, 107, 0.12);
    color: var(--brand-primary, #0F4E6B);
}

.broadcast-history-item__body {
    margin: 0.35rem 0 0;
    white-space: pre-wrap;
    line-height: 1.45;
    color: #475569;
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.broadcast-ack-list {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(15, 78, 107, 0.15);
    display: grid;
    gap: 0.3rem;
}

.broadcast-ack-list__empty {
    color: #94a3b8;
    font-size: 0.75rem;
}

.broadcast-ack-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.28rem 0.4rem;
    border-radius: 6px;
    background: rgba(15, 78, 107, 0.04);
}

.broadcast-ack-row__who {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.broadcast-ack-row__who strong {
    font-size: 0.78rem;
    color: #0f172a;
    line-height: 1.3;
}

.broadcast-ack-row__who span {
    font-size: 0.7rem;
    color: #64748b;
    direction: ltr;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.broadcast-ack-row__when {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: #64748b;
}

.broadcast-history-item .mud-button-root {
    min-height: 28px !important;
    padding: 0 0.35rem !important;
    font-size: 0.75rem !important;
}

.broadcast-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.broadcast-popup {
    width: min(520px, 100%);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    padding: 1.5rem 1.4rem 1.25rem;
    text-align: center;
    animation: broadcast-popup-in 0.28s ease-out;
}

.broadcast-popup__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(15, 78, 107, 0.1);
    color: var(--brand-primary, #0F4E6B);
    font-size: 1.4rem;
}

.broadcast-popup__title {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
    color: #0f172a;
    font-weight: 700;
}

.broadcast-popup__body {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.8;
    color: #334155;
    font-size: 0.98rem;
    text-align: right;
}

.broadcast-popup__meta {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 0.8rem;
}

.broadcast-popup__actions {
    margin-top: 1.25rem;
}

@keyframes broadcast-popup-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.layout-theme.theme-dark .broadcast-history-item,
body.app-dark-mode .broadcast-history-item {
    background: #092735 !important;
    border-color: #355B6D !important;
}

.layout-theme.theme-dark .broadcast-history-item__head strong,
body.app-dark-mode .broadcast-history-item__head strong,
.layout-theme.theme-dark .broadcast-popup__title,
body.app-dark-mode .broadcast-popup__title {
    color: #f8fafc;
}

.layout-theme.theme-dark .broadcast-history-item__body,
body.app-dark-mode .broadcast-history-item__body,
.layout-theme.theme-dark .broadcast-popup__body,
body.app-dark-mode .broadcast-popup__body {
    color: #cbd5e1;
}

.layout-theme.theme-dark .broadcast-popup,
body.app-dark-mode .broadcast-popup {
    background: #0f172a;
}

.layout-theme.theme-dark .broadcast-ack-row,
body.app-dark-mode .broadcast-ack-row {
    background: rgba(148, 163, 184, 0.08);
}

.layout-theme.theme-dark .broadcast-ack-row__who strong,
body.app-dark-mode .broadcast-ack-row__who strong {
    color: #f8fafc;
}

.layout-theme.theme-dark .broadcast-empty,
body.app-dark-mode .broadcast-empty {
    color: #94a3b8;
}

.layout-theme.theme-dark .broadcast-badge--active {
    background: rgba(15, 78, 107, 0.12);
    color: #AEBDC5;
}

@media (max-width: 640px) {
    .broadcast-history-item__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .broadcast-popup {
        padding: 1.25rem 1rem 1rem;
    }
}
