/* Global authenticated topbar: r233 pilot2 */
.sb-global-topbar {
    position: sticky;
    z-index: 1000;
    top: 0;
    width: 100%;
    height: 78px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(13,17,14,.94);
    backdrop-filter: blur(18px);
    color: #eef1ed;
    font-family: inherit;
}

.sb-global-topbar,
.sb-global-topbar * {
    box-sizing: border-box;
}

.sb-global-brand {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.sb-global-brand-mark {
    min-width: 54px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0 10px;
    border: 1px dashed rgba(234,215,170,.5);
    border-radius: 11px;
    color: #ead7aa;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.sb-global-brand-name {
    color: #eef1ed;
    font-size: 1.15rem;
    font-weight: 780;
    letter-spacing: -.035em;
}

.sb-global-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #99a39c;
    font-size: .86rem;
    white-space: nowrap;
}

.sb-global-summary > span {
    color: #99a39c;
    font-size: inherit;
    letter-spacing: normal;
}

.sb-global-summary strong {
    color: #eef1ed;
}

.sb-global-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #65c77b;
    box-shadow: 0 0 0 5px rgba(101,199,123,.1);
}

.sb-global-summary-divider {
    width: 1px;
    height: 18px;
    margin: 0 6px;
    background: rgba(255,255,255,.14);
}

.sb-global-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sb-global-icon,
.sb-global-profile {
    border: 0;
    color: #eef1ed;
    font: inherit;
}

.sb-global-icon {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    background: rgba(255,255,255,.03);
    color: #ead7aa;
    text-decoration: none;
    font-size: .9rem;
    cursor: pointer;
}

.sb-global-icon > span {
    color: inherit;
    font-size: 1rem;
    letter-spacing: normal;
}

.sb-global-icon:hover,
.sb-global-icon:focus-visible {
    border-color: rgba(255,255,255,.18);
    color: #eef1ed;
    outline: none;
}

.sb-global-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #0d110e;
    border-radius: 999px;
    background: #c65353;
    color: #fff;
    font-size: .55rem;
    font-weight: 900;
}

.sb-global-badge[hidden] {
    display: none;
}

.sb-global-profile {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.sb-global-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(200,170,109,.35);
    border-radius: 50%;
    background: linear-gradient(145deg,#26362b,#172019);
    color: #ead7aa;
    font-size: .72rem;
    font-weight: 800;
}

.sb-global-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.sb-global-profile-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.sb-global-profile-copy strong,
.sb-global-profile-copy small {
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-global-profile-copy strong {
    color: #eef1ed;
    font-size: .8rem;
}

.sb-global-profile-copy small {
    color: #99a39c;
    font-size: .68rem;
}

.sb-global-logout {
    border-radius: 11px;
    color: #99a39c;
    font-size: 1.2rem;
}

@media (max-width: 900px) {
    .sb-global-topbar {
        grid-template-columns: 1fr auto;
    }

    .sb-global-summary {
        display: none;
    }
}

@media (max-width: 560px) {
    .sb-global-topbar {
        height: 66px;
        gap: 10px;
        padding: 0 max(12px, env(safe-area-inset-left));
    }

    .sb-global-brand-name,
    .sb-global-profile-copy {
        display: none;
    }

    .sb-global-brand {
        gap: 0;
    }

    .sb-global-actions {
        gap: 7px;
    }
}

@media (max-width: 390px) {
    .sb-global-brand-mark {
        min-width: 42px;
        padding-inline: 7px;
    }

    .sb-global-actions {
        gap: 5px;
    }

    .sb-global-icon,
    .sb-global-avatar {
        width: 36px;
        height: 36px;
    }
}


/* Shared private chat drawer: r233 */
.sb-chat-backdrop {
    position: fixed;
    z-index: 1090;
    inset: 0;
    background: rgba(0,0,0,.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.sb-chat-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.sb-chat-drawer {
    position: fixed;
    z-index: 1100;
    top: 0;
    right: 0;
    width: min(520px,100%);
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto auto minmax(0,1fr) auto;
    overflow: hidden;
    border-left: 1px solid rgba(255,255,255,.1);
    background: #121814;
    box-shadow: -24px 0 70px rgba(0,0,0,.32);
    color: #eef1ed;
    transform: translateX(102%);
    transition: transform .22s ease;
}

.sb-chat-drawer.open {
    transform: translateX(0);
}

.sb-chat-drawer[aria-hidden="true"] {
    pointer-events: none;
}

.sb-chat-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(13,17,14,.96);
}

.sb-chat-header-copy {
    min-width: 0;
}

.sb-chat-header-copy span {
    display: block;
    color: #ead7aa;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .16em;
}

.sb-chat-header-copy h2 {
    margin: 3px 0 0;
    overflow: hidden;
    color: #eef1ed;
    font-size: 1.12rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-chat-close,
.sb-chat-back {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 11px;
    background: rgba(255,255,255,.03);
    color: #aab3ac;
    font: inherit;
    cursor: pointer;
}

.sb-chat-status {
    min-height: 32px;
    padding: 9px 16px 5px;
    color: #9fa8a1;
    font-size: .7rem;
}

.sb-chat-tabs {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 6px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sb-chat-tabs button {
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #9fa8a1;
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
}

.sb-chat-tabs button.active {
    border-color: rgba(200,170,109,.28);
    background: rgba(200,170,109,.09);
    color: #ead7aa;
}

.sb-chat-content {
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
    scrollbar-width: thin;
}

.sb-chat-panel[hidden] {
    display: none;
}

.sb-chat-section + .sb-chat-section {
    margin-top: 18px;
}

.sb-chat-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.sb-chat-section-title h3 {
    margin: 0;
    color: #eef1ed;
    font-size: .85rem;
}

.sb-chat-count {
    min-width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(200,170,109,.14);
    color: #ead7aa;
    font-size: .65rem;
    font-weight: 850;
}

.sb-chat-count[hidden] {
    display: none;
}

.sb-chat-list {
    display: grid;
    gap: 8px;
}

.sb-chat-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 40px minmax(0,1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    color: #eef1ed;
    text-decoration: none;
}

button.sb-chat-item {
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.sb-chat-item:hover,
.sb-chat-item:focus-visible {
    border-color: rgba(200,170,109,.3);
    background: rgba(200,170,109,.055);
    outline: none;
}

.sb-chat-list-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(200,170,109,.3);
    border-radius: 50%;
    background: linear-gradient(145deg,#26362b,#172019);
    color: #ead7aa;
    font-size: .7rem;
    font-weight: 850;
}

.sb-chat-list-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.sb-chat-item-copy {
    min-width: 0;
}

.sb-chat-item-title,
.sb-chat-item-preview,
.sb-chat-item-meta,
.sb-chat-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sb-chat-item-title {
    justify-content: space-between;
}

.sb-chat-item-title strong,
.sb-chat-item-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-chat-item-title strong {
    font-size: .8rem;
}

.sb-chat-vip {
    color: #ead7aa;
    font-size: .58rem;
    font-weight: 900;
}

.sb-chat-item-preview {
    justify-content: space-between;
    margin-top: 4px;
    color: #a6afa8;
    font-size: .7rem;
}

.sb-chat-item-meta {
    justify-content: space-between;
    margin-top: 5px;
    color: #7f8982;
    font-size: .61rem;
}

.sb-chat-unread {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: #c9a75f;
    color: #17130b;
    font-size: .58rem;
}

.sb-chat-actions {
    flex-wrap: wrap;
    margin-top: 8px;
}

.sb-chat-action {
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    background: rgba(255,255,255,.035);
    color: #eef1ed;
    font: inherit;
    font-size: .65rem;
    font-weight: 800;
    cursor: pointer;
}

.sb-chat-action.accept {
    color: #bfe9c7;
}

.sb-chat-action.reject {
    color: #efb7b7;
}

.sb-chat-action:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.sb-chat-search {
    display: grid;
    gap: 7px;
}

.sb-chat-search label {
    color: #a6afa8;
    font-size: .7rem;
}

.sb-chat-search-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 7px;
}

.sb-chat-search input {
    min-width: 0;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 9px;
    outline: none;
    background: rgba(0,0,0,.2);
    color: #eef1ed;
    font: inherit;
    font-size: .76rem;
}

.sb-chat-empty,
.sb-chat-search-message {
    padding: 16px 8px;
    color: #939d96;
    font-size: .72rem;
    text-align: center;
}

.sb-chat-search-message.error {
    color: #efb7b7;
}

.sb-chat-note {
    margin: 0;
    padding: 10px 14px 13px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #8f9992;
    font-size: .65rem;
    line-height: 1.4;
}

.sb-chat-note a {
    color: #ead7aa;
}

.sb-chat-conversation {
    z-index: 1110;
    grid-template-rows: auto minmax(0,1fr);
}

.sb-chat-conversation .sb-chat-header {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
}

.sb-chat-frame {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #0f1611;
}

@media (max-width: 560px) {
    .sb-chat-drawer {
        width: 100%;
        border-left: 0;
    }

    .sb-chat-header {
        min-height: 66px;
        padding: 9px 11px;
    }

    .sb-chat-content {
        padding: 10px;
    }

    .sb-chat-tabs {
        padding-inline: 10px;
    }
}


/* Global Social and Marketplace navigation: r233 */
.sb-global-page-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sb-global-page-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 11px;
    background: rgba(255,255,255,.03);
    color: #99a39c;
    text-decoration: none;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.sb-global-page-link:hover,
.sb-global-page-link:focus-visible {
    border-color: rgba(200,170,109,.48);
    background: rgba(200,170,109,.1);
    color: #eef1ed;
    outline: none;
}

.sb-global-page-link > span {
    color: inherit;
    font-size: inherit;
    letter-spacing: normal;
}

@media (max-width: 1120px) {
    .sb-global-page-link {
        width: 38px;
        padding: 0;
        border-radius: 50%;
    }

    .sb-global-page-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (max-width: 390px) {
    .sb-global-topbar {
        padding-inline: 8px;
    }

    .sb-global-brand-mark {
        min-width: 42px;
        padding-inline: 6px;
    }

    .sb-global-actions,
    .sb-global-page-links {
        gap: 4px;
    }

    .sb-global-page-link,
    .sb-global-icon,
    .sb-global-avatar {
        width: 34px;
        height: 34px;
        min-height: 34px;
    }
}


/* Shared profile width protection: r233 */

/* Su desktop avatar, nickname e livello non vengono compressi. */
.sb-global-actions {
    min-width: max-content;
}

.sb-global-profile {
    min-width: max-content;
    flex: 0 0 auto;
}

.sb-global-profile-copy {
    min-width: 92px;
    flex: 0 0 auto;
}

.sb-global-profile-copy strong,
.sb-global-profile-copy small {
    max-width: 150px;
}

/*
 * Quando lo spazio diminuisce, diventano compatte prima le
 * scorciatoie: il profilo resta leggibile.
 */
@media (max-width: 1180px) {
    .sb-global-topbar .sb-global-page-link {
        width: 38px;
        padding-inline: 0;
        border-radius: 50%;
    }

    .sb-global-topbar .sb-global-page-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (max-width: 560px) {
    .sb-global-actions,
    .sb-global-profile,
    .sb-global-profile-copy {
        min-width: 0;
    }
}


/* Private chat iframe flash prevention: r233 */
.sb-chat-frame {
    opacity: 0;
    background: #0f1611;
    color-scheme: dark;
}

.sb-chat-frame.loaded {
    opacity: 1;
}
