/* =========================================================
   SOCIAL INBOX
========================================================= */

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inbox-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.inbox-item-top {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.inbox-channel-badge {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    flex: 0 0 auto;
}

/* Each platform on its own colour, as they publish them. */
.inbox-channel-badge.fb { background: #0866ff; }
.inbox-channel-badge.ig { background: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 45%, #6228d7 100%); }
.inbox-channel-badge.tiktok { background: #010101; }
.inbox-channel-badge.linkedin { background: #0a66c2; }
.inbox-channel-badge.gbp { background: #1a73e8; }
.inbox-channel-badge.wa { background: #25d366; }

.inbox-customer {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text);
}

.inbox-meta {
    font-size: 10px;
    color: var(--text-3);
}

.inbox-risk {
    margin-left: auto;
}

.inbox-question {
    font-size: 12.5px;
    color: var(--text);
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.inbox-draft-box {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: var(--primary-soft-2);
}

.inbox-draft-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.inbox-draft-text {
    font-size: 12px;
    color: var(--text);
    line-height: 1.55;
}

.inbox-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-3);
    margin-top: 8px;
}

.inbox-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.review-summary-strip {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}

.review-score {
    text-align: center;
}

.review-score-value {
    font-size: 30px;
    font-weight: 800;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--warning);
}

.review-score-stars {
    font-size: 11px;
    color: var(--warning);
    margin-top: 2px;
}

.review-score-count {
    font-size: 10px;
    color: var(--text-3);
    margin-top: 2px;
}

.review-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-2);
}

.review-bar-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.review-bar-fill {
    height: 100%;
    background: var(--warning);
    border-radius: 999px;
}

.review-stars-inline {
    color: var(--warning);
    font-size: 12px;
    margin-bottom: 6px;
}

/* ---------- posts by channel, and the thread beside them ---------- */

.inbox-split {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

/* One phone-width column: the post list, then the thread under it. */
@media (max-width: 900px) {
    .inbox-split {
        grid-template-columns: 1fr;
    }
}

.inbox-posts {
    max-height: 640px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding-right: 12px;
}

@media (max-width: 900px) {
    .inbox-posts {
        max-height: 320px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 0 0 12px;
    }
}

.inbox-channel-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.inbox-channel-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
    transition: background var(--transition), border-color var(--transition);
}

.inbox-channel-tab:hover {
    background: var(--surface-soft);
}

.inbox-channel-tab.is-active {
    border-color: var(--primary);
    background: var(--primary-soft-2);
    color: var(--text);
}

.inbox-post {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    transition: background var(--transition);
}

.inbox-post:hover {
    background: var(--surface-soft);
}

.inbox-post.is-selected {
    background: var(--primary-soft-2);
}

/* The post's own picture, so a row is recognisable at a glance. */
.inbox-post-thumb {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.inbox-post-body {
    min-width: 0;
}

.inbox-post-text {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
}

.inbox-post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--text-3);
}

/* How many comments nobody has answered — the reason to open this post. */
.inbox-post-badge {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.inbox-thread {
    max-height: 640px;
    overflow-y: auto;
}

/* ---------- the post, as it was published ---------- */

.post-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    padding: 14px 16px 12px;
    margin-bottom: 16px;
}

.post-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    flex-shrink: 0;
}

.post-source {
    min-width: 0;
}

.post-source-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.post-time {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 1px;
}

/* Leaving the app is an explicit choice, so the link says where it goes. */
.post-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-2);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.post-open:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.post-open svg {
    width: 13px;
    height: 13px;
}

/* Big enough to recognise the post at a glance, small enough that the caption
   and the first comment stay on screen — this is a screen for replying. */
.post-media {
    position: relative;
    /* Centred: the media is the post's subject, and the card is wider than it. */
    margin: 14px auto 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface-soft);
    width: fit-content;
    max-width: 100%;
}

.post-media img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 300px;
}

.post-media.is-video::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(15, 23, 42, .55)
        url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E")
        no-repeat center / 22px 22px;
}

/* Devanagari matras need the extra leading; 68ch keeps the line readable. */
.post-caption {
    /* Left, under the header — only the media is centred. */
    margin: 14px 0 0;
    max-width: 72ch;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.post-caption.is-folded {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-caption-empty {
    color: var(--text-3);
}

/* Tags carry no message; they sit behind the words that do. */
.post-tag {
    color: var(--text-3);
}

.post-more {
    display: block;
    margin: 6px 0 0;
    padding: 0;
    background: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
}

.post-more:hover {
    text-decoration: underline;
}

.post-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-3);
}

.post-stat-waiting {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-soft-2);
    color: var(--primary-dark);
    font-weight: 700;
}

.inbox-reply {
    margin: 8px 0 0 20px;
    padding: 8px 12px;
    border-left: 2px solid var(--border);
    background: var(--surface-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.inbox-reply-who {
    font-size: 10.5px;
    font-weight: 700;
}

.inbox-reply-who span {
    color: var(--text-3);
    font-weight: 400;
}

.inbox-reply-text {
    font-size: 11.5px;
    margin-top: 2px;
}

/* The post as it went out, above its comments. */
.inbox-thread-media {
    display: block;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    max-width: 320px;
}

.inbox-thread-media img {
    display: block;
    width: 100%;
    /* A portrait post must not push its comments off the screen. */
    max-height: 320px;
    object-fit: cover;
}

/* A video's thumbnail says so, since playing it happens on the platform. */
.inbox-thread-media.is-video::after {
    content: "▶";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    background: rgba(15, 23, 42, .35);
}

.inbox-thread-post {
    white-space: pre-wrap;
}
