/* Compact inbox controls and a consistent reading order for each conversation. */
.nwc-app .nwc-inbox,
.nwc-app[data-view="inbox"] > .nwc-top {
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.nwc-app .nwc-inbox {
    --inbox-surface: #19151a;
    --inbox-raised: #28222b;
    --inbox-divider: #3a303b;
    --inbox-readable: #d0c1cd;
    --inbox-accent: #ffc4dc;
    background: var(--inbox-surface);
    border-color: var(--inbox-divider);
}

.nwc-app[data-view="inbox"] > .nwc-top {
    padding-inline: clamp(.8rem, 2.3vw, 1.45rem);
    border-color: #3a303b;
    background: #1c171c;
}

.nwc-app .nwc-inbox-menu > summary,
.nwc-app[data-view="inbox"] .nwc-gear-slot .nwe-app-settings > summary {
    padding: 0;
    inline-size: 44px;
    block-size: 44px;
    border: 0;
    border-radius: 50%;
    color: #fff2fa;
    background: transparent;
}

.nwc-app .nwc-inbox-menu > summary:hover,
.nwc-app .nwc-inbox-menu[open] > summary,
.nwc-app[data-view="inbox"] .nwc-gear-slot .nwe-app-settings > summary:hover,
.nwc-app[data-view="inbox"] .nwc-gear-slot .nwe-app-settings[open] > summary { background: #322631; }

.nwc-app .nwc-inbox-menu > summary > svg { inline-size: 21px; block-size: 21px; }

.nwc-app .nwc-inbox-menu .nwc-main-menu > button,
.nwc-app .nwc-inbox-menu .nwc-main-menu > a {
    display: flex;
    align-items: center;
    min-block-size: 44px;
    inline-size: 100%;
    padding: .45rem .6rem;
    border: 0;
    border-radius: 7px;
    color: #fff2fa;
    background: transparent;
    text-align: start;
    text-decoration: none;
}

.nwc-app .nwc-inbox-menu .nwc-main-menu > button:hover,
.nwc-app .nwc-inbox-menu .nwc-main-menu > a:hover { background: #443244; }

.nwc-app .nwc-inbox .nwc-inboxbar { gap: .55rem; padding: 0 0 .5rem; }

.nwc-app .nwc-inbox .nwc-mailbox-bar { margin: 0 0 .45rem; }
.nwc-app .nwc-inbox[data-single-personal-mailbox] .nwc-mailbox-bar { margin: 0; }

.nwc-app .nwc-inbox[data-single-personal-mailbox] .nwc-mailbox-context[data-kind="member"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.nwc-app .nwc-inbox .nwc-inbox-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .48rem;
    margin: 0;
}

.nwc-app .nwc-inbox .nwc-inbox-actions > .nwc-inbox-new { grid-column: 2; }

.nwc-app .nwc-inbox .nwc-inbox-search-toggle,
.nwc-app .nwc-inbox .nwc-inbox-new {
    display: inline-flex;
    align-items: center;
    min-inline-size: 0;
    min-block-size: 44px;
    padding: .55rem .72rem;
    border: 1px solid var(--inbox-divider);
    border-radius: 22px;
    font-size: .88rem;
    line-height: 1.2;
}

.nwc-app .nwc-inbox .nwc-inbox-search-toggle {
    inline-size: 100%;
    color: var(--inbox-readable);
    background: var(--inbox-raised);
    text-align: start;
}

.nwc-app .nwc-inbox .nwc-inbox-search-toggle:hover { background: #37303a; }

.nwc-app .nwc-inbox .nwc-inbox-new {
    justify-content: center;
    border-color: #883e60;
    color: #fff0f8;
    background: #722447;
    font-weight: 650;
    white-space: nowrap;
}

.nwc-app .nwc-inbox .nwc-inbox-new:hover { background: #88305b; }

.nwc-app .nwc-inbox .nwc-inbox-actions svg {
    flex: none;
    inline-size: 18px;
    block-size: 18px;
    margin-inline-end: .32rem;
}

.nwc-app .nwc-inbox .nwc-inboxbar > .nwc-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: .3rem;
    padding: .05rem 0 .42rem;
    background: var(--inbox-surface);
}

.nwc-app .nwc-inbox .nwc-filter-bar > button {
    min-inline-size: 0;
    min-block-size: 44px;
    padding: .34rem .12rem;
    border: 1px solid var(--inbox-divider);
    border-radius: 11px;
    color: var(--inbox-readable);
    background: #211b23;
    text-align: center;
    font-size: .8rem;
    line-height: 1.15;
}

.nwc-app .nwc-inbox .nwc-filter-bar > button:hover { background: #332733; }

.nwc-app .nwc-inbox .nwc-filter-bar > button[aria-pressed="true"] {
    border-color: #9f5476;
    color: #fff3fa;
    background: #52283e;
    font-weight: 700;
}

.nwc-app .nwc-inbox .nwc-filter-bar [data-nwchat-legacy-filter] { grid-column: 1 / -1; }

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

.nwc-app .nwc-inbox .nwc-threads { gap: 0; }
.nwc-app .nwc-inbox .nwc-threads > li + li { border-top: 1px solid var(--inbox-divider); }

.nwc-app .nwc-inbox .nwc-threads .nwc-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    min-block-size: 66px;
    gap: .58rem;
    padding: .46rem .38rem;
    border-radius: 9px;
    color: #f6ecf2;
    text-align: start;
}

.nwc-app .nwc-inbox .nwc-threads .nwc-row:hover { background: #282129; }
.nwc-app .nwc-inbox .nwc-threads .nwc-row[aria-current="true"] { background: #31232e; }

.nwc-app .nwc-inbox .nwc-threads .nwc-avatar {
    inline-size: 42px;
    block-size: 42px;
    color: #ffe5f1;
    background: #4b293e;
}

.nwc-app .nwc-inbox .nwc-threads .nwc-rowcopy { gap: .14rem; }

.nwc-app .nwc-inbox .nwc-threads .nwc-rowname {
    font-size: .96rem;
    font-weight: 650;
    line-height: 1.2;
}

.nwc-app .nwc-inbox .nwc-threads .nwc-rowpreview {
    color: var(--inbox-readable);
    font-size: .84rem;
    line-height: 1.25;
}

.nwc-app .nwc-inbox .nwc-threads .nwc-row[data-unread="true"] .nwc-rowname { font-weight: 750; }
.nwc-app .nwc-inbox .nwc-threads .nwc-row[data-unread="true"] .nwc-rowpreview { color: #f7e4ee; }

.nwc-app .nwc-inbox .nwc-threads .nwc-rowmeta {
    align-self: start;
    min-inline-size: 2.45rem;
    gap: .22rem;
    padding-block-start: .19rem;
}

.nwc-app .nwc-inbox .nwc-threads .nwc-rowtime { color: var(--inbox-readable); }
.nwc-app .nwc-inbox .nwc-threads .nwc-row[data-unread="true"] .nwc-rowtime { color: var(--inbox-accent); }

.nwc-app .nwc-inbox .nwc-threads .nwc-badge {
    min-inline-size: 1.28rem;
    padding: .05rem .32rem;
    color: #281b25;
    background: var(--inbox-accent);
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
}

.nwc-app .nwc-inbox .nwc-inbox-circle-link {
    margin: .4rem .38rem 0;
    color: var(--inbox-readable);
    font-size: .85rem;
}

.nwc-app .nwc-inbox .nwc-message-search { gap: .65rem; }

.nwc-app .nwc-inbox .nwc-message-search-form input {
    min-inline-size: 0;
    min-block-size: 44px;
    padding: .55rem .65rem;
    border: 1px solid #685368;
    border-radius: 9px;
    color: #fff1f8;
    background: var(--inbox-raised);
}

.nwc-app .nwc-inbox .nwc-message-search-form input::placeholder { color: var(--inbox-readable); }

@media (max-width: 700px) {
    .nwc-app .nwc-inbox .nwc-inboxbar { display: contents; }
    .nwc-app .nwc-inbox .nwc-inboxbar > .nwc-inbox-actions { margin-block-end: .52rem; }
    .nwc-app .nwc-inbox .nwc-inboxbar > .nwc-filter-bar {
        position: sticky;
        top: 0;
        z-index: 1;
    }
}

@media (max-width: 360px) {
    .nwc-app .nwc-inbox .nwc-filter-bar > button { font-size: .755rem; }
    .nwc-app .nwc-inbox .nwc-threads .nwc-row { gap: .45rem; }
}
