/* Zone18 — Chat moderne */

body.z18-chat-velzon.z18-velzon-test .page-content {
    padding-bottom: 0 !important;
}

body.z18-chat-velzon.z18-velzon-test .page-content > .container-fluid {
    padding-bottom: 0 !important;
}

body.z18-chat-velzon.z18-velzon-test #main-content,
body.z18-chat-velzon.z18-velzon-test #content,
body.z18-chat-velzon.z18-velzon-test #content > .centered {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.z18-chat-velzon.z18-velzon-test #content > .centered > .clear {
    display: none;
}

.z18-chat-page {
    --z18c-red: #e5483f;
    --z18c-ink: #343a40;
    --z18c-muted: #878a99;
    --z18c-line: #e4e7eb;
    --z18c-soft: #f5f6f8;
    --z18c-dark: #262a2f;

    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 520px;
    overflow: hidden;
}

.z18-chat-top {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.z18-chat-page .z18-chat-info-hero {
    margin: 0;
    padding: 8px 12px;
    min-height: 0;
}

.z18-chat-page .z18-chat-info-hero .z18-info-hero-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
}

.z18-chat-page .z18-chat-info-hero h1 {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
}

.z18-chat-page .z18-chat-info-hero p {
    margin: 1px 0 0;
    font-size: 11px;
}

.z18-chat-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.z18-chat-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(10, 179, 156, .14);
    color: #0ab39c;
    font-size: 11px;
    font-weight: 700;
}

.z18-chat-live-pill i {
    font-size: 12px;
    animation: z18ChatLive 1.6s ease-in-out infinite;
}

@keyframes z18ChatLive {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

/* Salon tabs */
body.z18-velzon-test .z18-chat-page .z18-chat-salon-tabs,
.z18-chat-page .z18-chat-salon-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 8px;
    border-radius: 12px;
    background: var(--z18c-dark);
    max-height: none;
    overflow: visible;
}

body.z18-velzon-test .z18-chat-page .z18-chat-salon-tabs a,
.z18-chat-page .z18-chat-salon-tabs a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .62);
    background: transparent;
    border: 0;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    text-transform: none;
    box-shadow: none;
}

body.z18-velzon-test .z18-chat-page .z18-chat-salon-tabs a i,
.z18-chat-page .z18-chat-salon-tabs a i {
    font-size: 15px;
    color: rgba(255, 255, 255, .55);
}

body.z18-velzon-test .z18-chat-page .z18-chat-salon-tabs a:hover,
.z18-chat-page .z18-chat-salon-tabs a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

body.z18-velzon-test .z18-chat-page .z18-chat-salon-tabs a.is-active,
.z18-chat-page .z18-chat-salon-tabs a.is-active {
    color: #fff;
    background: var(--z18c-red);
}

body.z18-velzon-test .z18-chat-page .z18-chat-salon-tabs a.is-active i,
.z18-chat-page .z18-chat-salon-tabs a.is-active i {
    color: #fff;
}

.z18-chat-page .z18-chat-salon-tabs a.has-new:not(.is-active) {
    color: #fff;
    background: rgba(229, 72, 63, .18);
}

.z18-chat-salon-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff8b84;
    box-shadow: 0 0 0 3px rgba(255, 139, 132, .2);
}

/* Workspace */
.z18-chat-workspace {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.z18-chat-stage {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.z18-chat-main {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.z18-chat-layout.chat-layout,
.z18-chat-page .chat-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 220px !important;
    gap: 8px !important;
    flex: 1 1 0;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    overflow: hidden !important;
    align-content: stretch;
}

.z18-chat-messages,
.z18-chat-users {
    display: flex;
    flex-direction: column;
    min-height: 0 !important;
    max-height: 100%;
    border: 1px solid #e8ebef;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    overflow: hidden;
}

.z18-chat-messages {
    position: relative;
    min-width: 0 !important;
}

.z18-chat-users {
    width: 220px;
    min-width: 220px !important;
    max-width: 220px !important;
}

/* Scroll interne : la zone ne doit jamais agrandir la grille */
.z18-chat-page .chat-scroll {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: 100% !important;
    background: #fff;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.z18-chat-page .chat-message-scroll {
    display: block !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
}

.z18-chat-page .chat-users-scroll {
    padding: 0 !important;
}

.z18-chat-msg {
    display: grid !important;
    grid-template-columns: 44px 120px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 6px 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    line-height: 1.35 !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.z18-chat-page .chat-message-scroll > .z18-chat-msg:nth-child(even) {
    background: #f3f5f8 !important;
}

.z18-chat-msg:hover {
    background: #eef1f5 !important;
}

.z18-chat-msg.is-own-message {
    background: #fff7f6 !important;
    box-shadow: inset 3px 0 0 var(--z18c-red);
}

.z18-chat-page .chat-message-scroll > .z18-chat-msg.is-own-message:nth-child(even) {
    background: #ffefed !important;
}

.z18-chat-msg.is-system {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    background: #eef1f5 !important;
}

.z18-chat-msg .chat-message-time {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    padding-top: 0;
    white-space: nowrap;
    overflow: hidden;
}

.z18-chat-msg-author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.z18-chat-msg-author img {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.z18-chat-msg-author b {
    color: var(--z18c-ink);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.z18-chat-msg.is-own-message .z18-chat-msg-author b {
    color: var(--z18c-red);
}

.z18-chat-msg-text {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.z18-chat-msg-text img {
    vertical-align: middle;
}

.z18-chat-msg-system {
    color: #64748b;
    font-size: 12px;
    font-style: italic;
    font-weight: 600;
}

.z18-chat-jump-bottom {
    position: absolute;
    right: 12px;
    bottom: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--z18c-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(38, 42, 47, .22);
}

.z18-chat-jump-bottom[hidden] {
    display: none !important;
}

.z18-chat-jump-bottom:hover {
    background: var(--z18c-red);
}

/* Users */
.z18-chat-users .chat-users-scroll {
    padding: 4px 0;
}

.z18-chat-user {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr) !important;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 10px;
    border: 0;
    border-bottom: 0;
    background: #fff;
}

.z18-chat-page .chat-users-scroll > .z18-chat-user:nth-child(even) {
    background: #f3f5f8;
}

.z18-chat-user:last-child {
    border-bottom: 0;
}

.z18-chat-user:hover {
    background: #eef1f5 !important;
}

.z18-chat-user.is-absent {
    opacity: .62;
}

.z18-chat-user-grade {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.z18-chat-user-main {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.z18-chat-user-name {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--z18c-ink) !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.z18-chat-user-name:hover,
.z18-chat-user-name:focus,
.z18-chat-user-name:active {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--z18c-red) !important;
    outline: 0 !important;
}

.z18-chat-user-name .spp-badge {
    background: #fff3f2 !important;
    border: 1px solid #e8c4c1 !important;
    color: #b22922 !important;
}

.z18-chat-user-name .chat-user-badge {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    vertical-align: middle;
    background: transparent !important;
    border: 0 !important;
}

.z18-chat-user-centre {
    color: var(--z18c-muted);
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty / banned */
.z18-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 36px 16px;
    text-align: center;
    color: var(--z18c-muted);
}

.z18-chat-empty i {
    font-size: 28px;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.z18-chat-empty strong {
    color: var(--z18c-ink);
    font-size: 14px;
}

.z18-chat-empty span {
    font-size: 12px;
}

.z18-chat-empty.is-compact {
    padding: 24px 12px;
}

.z18-chat-banned {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 220px;
    padding: 28px 18px;
    border: 1px solid rgba(229, 72, 63, .25);
    border-radius: 14px;
    background: #fff8f7;
    text-align: center;
}

.z18-chat-banned-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(229, 72, 63, .12);
    color: var(--z18c-red);
    font-size: 22px;
}

.z18-chat-banned h3 {
    margin: 4px 0 0;
    color: var(--z18c-ink);
    font-size: 16px;
}

.z18-chat-banned p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.z18-chat-banned-motif {
    margin: 4px 0 !important;
    color: var(--z18c-ink) !important;
}

/* Compose */
.z18-chat-compose {
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 1px solid #e8ebef;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

.z18-chat-compose-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.z18-chat-format {
    display: inline-flex;
    gap: 4px;
}

.z18-chat-tool {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--z18c-line);
    border-radius: 8px;
    background: var(--z18c-soft);
    color: #475569;
    cursor: pointer;
}

.z18-chat-tool:hover {
    border-color: #cfd5dc;
    color: var(--z18c-ink);
    background: #fff;
}

.z18-chat-smileys {
    position: relative;
}

.z18-chat-smileys > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--z18c-line);
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.z18-chat-smileys > summary::-webkit-details-marker {
    display: none;
}

.z18-chat-smileys-grid {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(8, 28px);
    gap: 4px;
    width: max-content;
    padding: 8px;
    border: 1px solid var(--z18c-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(38, 42, 47, .14);
}

.z18-chat-compose-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.z18-chat-textarea {
    width: 100%;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid #dce0e5;
    border-radius: 10px;
    background: #f8f9fb;
    color: var(--z18c-ink);
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
}

.z18-chat-textarea:focus {
    outline: 0;
    border-color: rgba(229, 72, 63, .45);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(229, 72, 63, .12);
}

.z18-chat-compose-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.z18-chat-abs-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    border: 1px solid var(--z18c-line);
    border-radius: 8px;
    color: #64748b;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.z18-chat-abs-link:hover {
    color: var(--z18c-ink);
    background: var(--z18c-soft);
}

.z18-chat-send {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--z18c-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.z18-chat-send:hover {
    background: #d43d35;
}

.z18-chat-send:disabled {
    opacity: .65;
    cursor: wait;
}

/* Private salons */
.z18-chat-private {
    flex: 0 0 auto;
    border: 1px solid #e8ebef;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.z18-chat-private > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: var(--z18c-ink);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    background: #fafbfc;
}

.z18-chat-private > summary::-webkit-details-marker {
    display: none;
}

.z18-chat-private-chevron {
    margin-left: auto;
    color: #94a3b8;
    transition: transform .15s ease;
}

.z18-chat-private[open] .z18-chat-private-chevron {
    transform: rotate(180deg);
}

.z18-chat-private-body {
    display: grid;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid #eef1f4;
}

.z18-chat-private-form label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.z18-chat-private-inline {
    display: flex;
    gap: 8px;
}

.z18-chat-private-inline input,
.z18-chat-private-inline select {
    flex: 1;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #dce0e5;
    border-radius: 8px;
    background: #fff;
}

.z18-chat-btn-light {
    padding: 8px 12px;
    border: 1px solid var(--z18c-line);
    border-radius: 8px;
    background: var(--z18c-soft);
    color: var(--z18c-ink);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.z18-chat-private-current {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8f9fb;
    font-size: 13px;
}

.z18-chat-leave {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--z18c-red);
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
}

.z18-chat-private-manage {
    display: grid;
    gap: 12px;
}

@media (max-width: 1100px) {
    .z18-chat-layout {
        grid-template-columns: 1fr !important;
    }

    .z18-chat-users {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        max-height: 160px;
    }
}

@media (max-width: 760px) {
    .z18-chat-compose-row {
        grid-template-columns: 1fr;
    }

    .z18-chat-compose-actions {
        justify-content: flex-end;
    }

    .z18-chat-msg {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .z18-chat-msg-author {
        grid-column: 2;
    }

    .z18-chat-msg-text {
        grid-column: 2;
    }

    .z18-chat-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
