/*
 * Service status banner.
 *
 * Two rendering contexts, one stylesheet: the full portal layout (two lines of body) and the embed
 * shell used by the browser extension's side panel and the phone app (one line, ~400px wide).
 * .service-status-compact selects the second.
 *
 * Height matters more than it looks. _Layout can already stack an impersonation banner and the
 * extension promo; a non-dismissible critical notice on top of those must not push the product off
 * screen, which is why the body is line-clamped rather than allowed to run.
 */

.service-status-host:empty {
    display: none;
}

.service-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--ssb-accent, #0d6efd);
    background: var(--ssb-bg, #eef4ff);
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.4;
}

.service-status-banner .ssb-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 1rem;
    color: var(--ssb-accent, #0d6efd);
}

.service-status-banner .ssb-text {
    flex: 1;
    min-width: 0; /* lets the clamped body actually shrink inside the flex row */
}

.service-status-banner .ssb-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.service-status-banner .ssb-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--ssb-accent, #0d6efd);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Unmistakably not live, so nobody mistakes a draft for a published notice. */
.service-status-banner .ssb-chip-preview {
    background: #6b7280;
}

.service-status-banner .ssb-body {
    margin-top: 2px;
    white-space: pre-line; /* the operator's line breaks survive; the text is plain, never HTML */
    overflow-wrap: anywhere;
}

.service-status-banner .ssb-body[data-clamped="true"] {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-status-banner .ssb-more {
    text-decoration: underline;
    font-size: 0.8rem;
}

.service-status-banner .ssb-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.service-status-banner .ssb-link {
    border: 1px solid var(--ssb-accent, #0d6efd);
    color: var(--ssb-accent, #0d6efd);
    white-space: nowrap;
}

.service-status-banner .ssb-link:hover {
    background: var(--ssb-accent, #0d6efd);
    color: #fff;
}

.service-status-banner .ssb-dismiss {
    color: #6b7280;
    padding: 0 4px;
}

/* Severity ------------------------------------------------------------- */

.service-status-banner.ssb-info {
    --ssb-accent: #0d6efd;
    --ssb-bg: #eef4ff;
}

.service-status-banner.ssb-minor {
    --ssb-accent: #b45309;
    --ssb-bg: #fff7e6;
}

.service-status-banner.ssb-major {
    --ssb-accent: #c2410c;
    --ssb-bg: #fff1e8;
}

.service-status-banner.ssb-critical {
    --ssb-accent: #b91c1c;
    --ssb-bg: #fdecec;
}

/* Compact (embed shell: side panel and phone app) ----------------------- */

.service-status-compact .service-status-banner {
    margin-bottom: 0;
    border-radius: 0;
    border-left: none;
    border-bottom: 2px solid var(--ssb-accent, #0d6efd);
    padding: 6px 10px;
    gap: 8px;
    font-size: 0.8rem;
}

/* One line of body at 400px, and the headline and body run together so the whole notice is a
   single strip above the chat rather than a block that eats the conversation. */
.service-status-compact .service-status-banner .ssb-body[data-clamped="true"] {
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.service-status-compact .service-status-banner .ssb-icon {
    font-size: 0.85rem;
}

.service-status-compact .service-status-banner .ssb-link {
    display: none; /* no room; the reader opens the full notice in the portal */
}
