/* Keep inbox controls and sender context clear on the compact Messages screen. */
.nwc-mailbox-bar {
    display: grid;
    gap: .4rem;
    min-inline-size: 0;
}

.nwc-mailbox-bar select {
    min-height: 44px;
    padding: .55rem .72rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #211b1e;
    color: #fff;
}

.nwc-app .nwc-mailbox-context {
    min-inline-size: 0;
    color: var(--rose);
    font-size: .85rem;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.nwc-filter-bar {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: .32rem;
}

.nwc-filter-bar [data-nwchat-filter] {
    border: 1px solid var(--line);
    line-height: 1.18;
    text-align: center;
}

.nwc-filter-bar [data-nwchat-filter][aria-pressed="true"] {
    border-color: #a65072;
}

.nwc-threads .nwc-row {
    border-inline-start: 2px solid transparent;
}

.nwc-threads .nwc-row[aria-current="true"] {
    border-inline-start-color: #cc7798;
    background: #302029;
}

.nwc-thread-identity {
    display: grid;
    flex: 1;
    gap: .18rem;
    min-inline-size: 0;
}

.nwc-app .nwc-thread-mailbox {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 550;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.nwc-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
}

.nwc-bubble-meta .nwc-bubble-reply {
    min-height: 28px;
    padding: .12rem .4rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--rose);
    font-size: .77rem;
    font-weight: 650;
}

.nwc-bubble-meta .nwc-bubble-reply:hover,
.nwc-bubble-meta .nwc-bubble-reply:focus-visible {
    background: rgba(255, 230, 240, .12);
}

.nwc-reply-quote,
.nwc-reply-preview {
    min-width: 0;
    padding: .45rem .6rem;
    border-inline-start: 2px solid #cc7798;
    border-radius: 6px;
    background: rgba(0, 0, 0, .2);
    color: #f5e8ee;
    font-size: .85rem;
    line-height: 1.32;
}

.nwc-reply-quote {
    margin: 0 0 .45rem;
}

.nwc-reply-preview {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    background: var(--surface);
}

.nwc-reply-preview-copy {
    min-width: 0;
}

.nwc-reply-quote strong,
.nwc-reply-preview-copy strong {
    display: block;
    color: var(--rose);
    overflow-wrap: anywhere;
}

.nwc-reply-quote span,
.nwc-reply-preview-copy span {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nwc-reply-clear {
    flex: 0 0 44px;
    padding: 0;
    font-size: 1.4rem;
}

.nwc-event-picker {
    flex: none;
    max-height: min(46vh, 24rem);
    overflow: auto;
    padding: .55rem .7rem .7rem;
    background: var(--panel);
    border-top: 1px solid var(--line);
}

.nwc-event-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .45rem;
}

.nwc-event-picker-header h3 {
    margin: 0;
    font-size: 1rem;
}

.nwc-event-picker-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .4rem;
}

.nwc-app .nwc-event-picker-search input {
    width: 100%;
    min-width: 0;
    padding: .55rem .65rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #211b1e;
    color: #fff;
}

.nwc-app .nwc-event-picker-status:not(:empty) {
    margin-top: .5rem;
}

.nwc-app .nwc-event-pick-results:not(:empty) {
    display: grid;
    gap: .38rem;
    margin-top: .45rem;
}

.nwc-app .nwc-event-card,
.nwc-app .nwc-event-pick-result {
    display: flex;
    align-items: center;
    gap: .55rem;
    max-width: 100%;
    padding: .45rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #20191d;
    color: #faf7f8;
    text-align: start;
    text-decoration: none;
}

.nwc-app .nwc-event-pick-result {
    width: 100%;
}

.nwc-app .nwc-event-card:hover,
.nwc-app .nwc-event-pick-result:hover {
    background: var(--hover);
}

.nwc-event-card-image {
    flex: 0 0 auto;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 6px;
    background: var(--surface);
    object-fit: cover;
}

.nwc-event-card-copy {
    display: grid;
    gap: .18rem;
    min-width: 0;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.nwc-event-card-title {
    font-weight: 650;
}

.nwc-event-card-detail {
    color: var(--muted);
    font-size: .8rem;
}

.nwc-app .nwc-event-pick-open {
    font-size: .85rem;
}

@media (min-width: 701px) {
    .nwc-workspace {
        grid-template-columns: minmax(17.5rem, 32%) minmax(0, 1fr);
    }

    .nwc-inbox {
        padding-inline: clamp(.7rem, 1.6vw, 1.1rem);
        padding-block-start: .9rem;
        background: #151215;
    }

    .nwc-inboxbar {
        gap: .55rem;
        padding-block-end: .8rem;
    }

    .nwc-threadbar {
        min-block-size: 3.8rem;
    }
}

@media (max-width: 700px) {
    /* The filters stick to the inbox rail instead of scrolling with its toolbar. */
    .nwc-inboxbar {
        display: contents;
    }

    .nwc-mailbox-bar {
        margin-bottom: .4rem;
    }

    .nwc-inboxbar > .nwc-filter-bar {
        position: sticky;
        top: 0;
        inset-block-start: 0;
        z-index: 1;
        padding-block: .2rem .45rem;
        background: var(--panel);
    }

    .nwc-inbox:not([data-search-active="true"]):has(.nwc-filter-bar:not([hidden])) {
        scroll-padding-block-start: var(--nwc-filter-scroll-offset, calc(44px + .9rem));
    }

    .nwc-filter-bar [data-nwchat-filter] {
        min-block-size: 44px;
        min-inline-size: 44px;
    }

    .nwc-inboxbar > .nwc-inbox-actions {
        margin-block-end: .55rem;
    }

    .nwc-inbox[data-search-active="true"] .nwc-filter-bar {
        display: none;
    }

    .nwc-thread > .nwc-threadbar {
        gap: .45rem;
    }

    .nwc-bubble-meta .nwc-bubble-reply {
        min-height: 44px;
    }
}

@media (max-width: 360px) {
    .nwc-filter-bar:has(> [data-nwchat-legacy-filter]:not([hidden])) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
    }

    .nwc-inbox:has(.nwc-filter-bar > [data-nwchat-legacy-filter]:not([hidden])) {
        --nwc-filter-scroll-offset: calc(88px + 1.5rem);
    }
}
