/* ================================================
   CHAT — DESIGN BRUTALIST / SOLID / PROFESSIONAL
   Regras: sem bordas, cores sólidas, sem animações
   estranhas, botões alinhados, mobile coerente.
   Este arquivo é carregado APÓS inbox.css e
   sobrescreve o que precisa ser sobrescrito.
   ================================================ */

:root {
    --chat-bg: #07030d;
    --chat-surface: #110823;
    --chat-surface-2: #180b30;
    --chat-surface-3: #1f0f3d;
    --chat-divider: #1a0e2e;
    --chat-accent: #8a05be;
    --chat-accent-strong: #6f02b4;
    --chat-gold: #fcc419;
    --chat-text: #ffffff;
    --chat-text-muted: #9b89b0;
    --chat-text-dim: #6d6487;
    --chat-danger: #ef4444;
    --chat-success: #22c55e;
}

/* ================================================
   RESET DE BORDAS NO CHAT 
   ================================================ */
.inbox-app,
.inbox-app * {
    border-color: transparent;
}

.inbox-app {
    background: var(--chat-bg);
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    height: calc(100dvh - 72px);
    transition: height 0.2s ease;
}

/* Ocultar elementos globais quando em conversa no mobile */
@media (max-width: 1100px) {

    body.in-conversation #app-header,
    body.in-conversation .bottom-nav {
        display: none !important;
    }

    body.in-conversation .inbox-app {
        height: 100dvh !important;
        margin: 0 !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        display: flex;
        flex-direction: column;
    }
}

/* ================================================
   COLUNA 1 — LISTA DE THREADS (sólida, sem bordas)
   ================================================ */
.inbox-threads {
    background: var(--chat-surface);
    border: 0 !important;
    border-right: 1px solid var(--chat-divider) !important;
    border-radius: 0 !important;
    box-shadow: none;
}

.inbox-threads__head {
    padding: 24px 20px 12px;
    background: var(--chat-surface);
}

.inbox-threads__head h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--chat-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.inbox-threads__head .counter {
    display: block;
    margin-top: 4px;
    margin-bottom: 0;
    font-size: 0.72rem;
    color: var(--chat-text-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 120ms ease;
}

.inbox-threads__head .counter.counter--has-unread {
    color: var(--chat-accent);
    font-weight: 700;
}

.inbox-threads .search-field {
    display: grid;
    align-items: center;
    margin-top: 16px !important;
    height: 44px;
    border: 0 !important;
    border-radius: 10px;
    background: var(--chat-surface-2);
    padding: 0 14px;
    grid-template-columns: 24px 1fr;
    gap: 8px;
}

.inbox-threads .search-field .material-symbols-rounded {
    color: var(--chat-text-muted);
    font-size: 1.15rem;
}

.inbox-threads .search-field input {
    color: var(--chat-text);
    font-size: 0.9rem;
    font-weight: 500;
    background: transparent;
}

.inbox-threads .search-field input::placeholder {
    color: var(--chat-text-dim);
}

/* Filtros — pílulas simples */
.inbox-threads .inbox-filters {
    margin: 14px 0 8px !important;
    display: flex;
    gap: 6px;
}

.inbox-app .pill {
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    background: transparent;
    color: var(--chat-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    border: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 120ms ease, color 120ms ease;
    cursor: pointer;
}

.inbox-app .pill:hover {
    color: var(--chat-text);
}

.inbox-app .pill--active {
    background: var(--chat-surface-2);
    color: var(--chat-text);
}

/* Contador discreto entre parênteses */
.pill__count {
    color: var(--chat-text-dim);
    font-size: 0.74rem;
    font-weight: 700;
}

.pill__count::before {
    content: "(";
}

.pill__count::after {
    content: ")";
}

.pill--active .pill__count {
    color: var(--chat-text-muted);
}

.pill__count--alert {
    color: var(--chat-accent) !important;
}

/* Lista */
.inbox-threads .thread-list {
    padding: 8px 8px 16px;
    gap: 2px;
}

.inbox-app .thread {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: 10px;
    border: 0 !important;
    background: transparent;
    transition: background 120ms ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 2px;
}

.inbox-app .thread:hover {
    background: rgba(255, 255, 255, 0.04);
}

.inbox-app .thread--active {
    background: var(--chat-surface-2) !important;
}

/* Bolinha roxa brilhante removida a pedido do usuário */
.inbox-app .thread--active::after {
    display: none;
}

.inbox-app .thread .avatar-wrapper {
    width: 50px;
    height: 50px;
}

.inbox-app .thread .avatar-wrapper img {
    border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
}

.inbox-app .thread .status-dot {
    width: 13px;
    height: 13px;
    border: 2px solid var(--chat-surface);
}

.thread--active .status-dot {
    border-color: var(--chat-surface-2);
}

.inbox-app .thread__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inbox-app .thread__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.inbox-app .thread__head strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--chat-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-app .thread__head span {
    font-size: 0.75rem;
    color: var(--chat-text-dim);
    font-weight: 500;
    flex-shrink: 0;
}

.thread__body-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.inbox-app .thread__info p {
    font-size: 0.88rem;
    color: var(--chat-text-muted);
    font-weight: 400;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    flex: 1;
}

.inbox-app .thread em {
    background: var(--chat-accent) !important;
    color: #fff !important;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-style: normal;
    line-height: 1;
}

/* Estado unread — destaque sutil sem berrar */
.inbox-app .thread--unread .thread__head strong {
    color: #fff;
    font-weight: 800;
}

.inbox-app .thread--unread .thread__info p {
    color: var(--chat-text);
    font-weight: 500;
}

.inbox-app .thread--unread .thread__head span {
    color: var(--chat-accent);
    font-weight: 700;
}

/* Empty state da lista — tom mais profissional */
.inbox-app .thread-empty {
    margin: 24px 12px;
    padding: 36px 20px;
    background: var(--chat-surface-2);
    border-radius: 12px;
}

.inbox-app .thread-empty .material-symbols-rounded {
    font-size: 32px;
    color: var(--chat-text-dim);
    opacity: 0.7;
}

.inbox-app .thread-empty p {
    font-size: 0.84rem;
    color: var(--chat-text-muted);
    line-height: 1.5;
    max-width: 28ch;
    margin: 0 auto;
}

.inbox-app .thread__info small {
    display: block;
    font-size: 0.75rem;
    color: var(--chat-text-dim);
    font-weight: 600;
    margin-top: 2px;
}

/* ================================================
   COLUNA 2 — CONVERSA (sem bordas, sólido)
   ================================================ */
.inbox-chat {
    background: var(--chat-bg);
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none;
    overflow: hidden;
}

/* Header da conversa — grid com áreas bem definidas */
.negotiation-panel {
    padding: 12px 20px;
    background: var(--chat-surface);
    border: 0 !important;
    border-bottom: 1px solid var(--chat-divider) !important;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    flex-shrink: 0;
}

/* Botão back fica antes; em desktop está hidden */
.negotiation-panel .chat-head__back {
    grid-column: 1;
}

.chat-user-info {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chat-user-info .avatar-wrapper {
    width: 42px;
    height: 42px;
}

.chat-user-info .status-dot {
    width: 12px;
    height: 12px;
    border-color: var(--chat-surface);
    bottom: 0px;
    right: 0px;
}

.chat-user-avatar {
    display: none;
}

.chat-user-details {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.chat-user-details h4 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--chat-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.chat-service-context {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--chat-text-muted);
    font-weight: 500;
    line-height: 1.15;
    min-width: 0;
}

.chat-service-context #ctx-service {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.chat-service-context .dot-separator {
    color: var(--chat-text-dim);
    font-weight: 700;
    flex-shrink: 0;
}

.chat-service-context .status-tag {
    background: var(--chat-accent) !important;
    color: #fff !important;
    border: 0 !important;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    flex-shrink: 0;
}

.negotiation-actions-desktop {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-right: 4px;
    border-right: 1px solid var(--chat-divider);
    margin-right: 0;
    height: 42px;
}

.negotiation-actions-desktop .proposal-price {
    padding-right: 14px;
}

.proposal-price {
    text-align: right;
    line-height: 1;
}

.proposal-price strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--chat-gold);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.negotiation-panel .chat-head__context-btn {
    grid-column: 4;
}

.chat-head__context-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--chat-surface-2);
    color: var(--chat-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 120ms ease;
}

.chat-head__context-btn:hover {
    background: var(--chat-surface-3);
}

.chat-head__context-btn .material-symbols-rounded {
    font-size: 1.2rem;
}

@media (min-width: 1101px) {
    .negotiation-panel {
        grid-template-columns: 1fr;
    }

    .negotiation-panel .chat-user-info {
        grid-column: 1;
    }

    .chat-head__context-btn,
    .context-panel__close {
        display: none !important;
    }

}

.chat-head__back {
    display: none !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--chat-text) !important;
    border: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 120ms ease;
}

.chat-head__back:hover {
    background: var(--chat-surface-2) !important;
}

.chat-head__back .material-symbols-rounded {
    font-size: 1.4rem !important;
}

@media (max-width: 1100px) {
    .inbox-app--conversation .chat-head__back {
        display: inline-flex !important;
    }
}

/* ================================================
   SCROLLBARS PERSONALIZADAS
   ================================================ */
.inbox-scroll {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 5, 190, 0.3) transparent;
}

.inbox-scroll::-webkit-scrollbar {
    width: 6px;
}

.inbox-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.inbox-scroll::-webkit-scrollbar-thumb {
    background: rgba(138, 5, 190, 0.2);
    border-radius: 10px;
}

.inbox-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--chat-accent);
}

/* ================================================
   CORPO DA CONVERSA — Mensagens
   ================================================ */
.inbox-chat .chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 8px;
    background: var(--chat-bg);
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--chat-surface-3) transparent;
}

.inbox-chat .chat-body::-webkit-scrollbar {
    width: 6px;
}

.inbox-chat .chat-body::-webkit-scrollbar-thumb {
    background: var(--chat-surface-3);
    border-radius: 6px;
}

/* Grupo de mensagens */
.bubble-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.bubble-group--in {
    align-items: flex-start;
}

.bubble-group--out {
    align-items: flex-end;
}

.bubble-group+.bubble-group {
    margin-top: 14px;
}

/* Bubble base — formato WhatsApp com timestamp inline */
.bubble {
    max-width: min(560px, 78%);
    padding: 7px 11px 6px 12px;
    border-radius: 14px;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 8px;
    row-gap: 0;
    border: 0 !important;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.18) !important;
    transition: background 140ms ease, transform 140ms ease !important;
    transform: none !important;
    position: relative;
    cursor: default;
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: none;
}

.bubble:hover {
    transform: none !important;
}

.bubble p {
    font-size: 0.93rem;
    line-height: 1.38;
    color: #fff;
    font-weight: 400;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.bubble>span {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    line-height: 1;
    margin-bottom: 2px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-left: auto;
}

/* Mensagens recebidas */
.bubble--in {
    align-self: flex-start;
    background: var(--chat-surface-2) !important;
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

/* Mensagens enviadas - cor sólida */
.bubble--out {
    align-self: flex-end;
    background: var(--chat-accent) !important;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble--out p {
    color: #fff;
}

.bubble--out>span {
    color: rgba(255, 255, 255, 0.78);
}

/* Cauda sutil no primeiro bubble do grupo (WhatsApp-like) */
.bubble--in:not(.bubble--consecutive)::before {
    content: "";
    position: absolute;
    left: -6px;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: var(--chat-surface-2);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    border-bottom-right-radius: 2px;
}

.bubble--out:not(.bubble--consecutive)::before {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: var(--chat-accent);
    clip-path: polygon(0 0, 100% 100%, 0 100%);
    border-bottom-left-radius: 2px;
}

/* Mensagens consecutivas — cantos achatados no lado do remetente */
.bubble--consecutive.bubble--in {
    border-top-left-radius: 6px;
}

.bubble--consecutive.bubble--out {
    border-top-right-radius: 6px;
}

/* Estado quando menu de contexto está aberto */
.bubble--menu-open {
    transform: scale(1.02) !important;
    background: var(--chat-surface-3) !important;
    z-index: 5;
}

.bubble--out.bubble--menu-open {
    background: var(--chat-accent-strong) !important;
}

/* Pressionado para long-press feedback */
.bubble:active {
    transform: scale(0.985) !important;
}

/* Removendo (animação de delete) */
.bubble--removing {
    animation: bubbleOut 180ms ease-in forwards !important;
    pointer-events: none;
}

@keyframes bubbleOut {
    to {
        opacity: 0;
        transform: scale(0.8) translateY(4px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
    }
}

/* Esconde timestamps de mensagens não-finais do grupo */
.bubble-group .bubble:not(:last-child)>span {
    display: none;
}

/* Mensagem de sistema — Estilo limpo, grande e legível */
.bubble--system {
    display: block !important;
    align-self: center;
    max-width: min(620px, 92%);
    width: auto;
    min-height: min-content !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    color: #f5f0ff !important;
    font-size: 0.86rem !important;
    font-weight: 500;
    line-height: 1.45;
    margin: 14px auto !important;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    box-sizing: border-box !important;
}

.bubble--system::before {
    display: none;
}

.bubble--system p {
    margin: 0;
}

.bubble--system p + br + p,
.bubble--system p + p {
    margin-top: 10px;
}

.bubble--system strong {
    color: #fff;
    font-weight: 850;
}

.bubble--system a {
    color: var(--chat-gold);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bubble--system .material-symbols-rounded {
    font-size: 1.25rem;
    color: var(--chat-gold);
    flex-shrink: 0;
}

.chat-feedback {
    position: fixed;
    left: 50%;
    bottom: calc(86px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 13000;
    width: min(420px, calc(100vw - 28px));
    min-height: 48px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 12, 32, 0.96);
    color: #f7f1ff;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
    animation: chatFeedbackIn 160ms ease-out;
    pointer-events: none;
}

.chat-feedback--leaving {
    animation: chatFeedbackOut 180ms ease-in forwards;
}

.chat-feedback__icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.12);
    color: var(--chat-gold);
    font-size: 1rem !important;
    line-height: 1;
}

.chat-feedback__text {
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.3;
    font-weight: 700;
    overflow-wrap: anywhere;
}

@keyframes chatFeedbackIn {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes chatFeedbackOut {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, 8px); }
}

/* Proposta substituída — versão compacta de uma linha */
.bubble--offer--ghost {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-left: 2px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    color: var(--chat-text-muted);
    font-size: 0.8rem;
    max-width: min(360px, 80%) !important;
    width: auto !important;
}

.bubble--offer--ghost .material-symbols-rounded {
    font-size: 1rem;
    opacity: 0.5;
    flex-shrink: 0;
}

/* Card de oferta */
.bubble--offer {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    background: var(--chat-surface-2) !important;
    border: 0 !important;
    border-left: 3px solid var(--chat-accent) !important;
    border-radius: 10px !important;
    padding: 18px !important;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bubble--offer__title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--chat-text);
}

.bubble--offer__price strong {
    font-size: 1.1rem;
    color: var(--chat-gold);
    font-weight: 800;
}

.bubble--offer__text {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.bubble--offer .btn-accept {
    align-self: flex-start;
    height: 40px;
    padding: 0 22px;
    background: var(--chat-accent) !important;
    color: #fff !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 0 !important;
    transition: background 120ms ease;
}

.bubble--offer .btn-accept:hover {
    background: var(--chat-accent-strong) !important;
    transform: none !important;
}

.bubble__image {
    max-width: 100%;
    max-height: 280px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}

/* Bubble enviando */
.bubble--sending {
    opacity: 0.55;
    background: var(--chat-surface-2) !important;
}

.bubble--sending::after {
    content: "Enviando...";
    font-size: 0.62rem;
    display: block;
    margin-top: 2px;
    text-align: right;
    color: rgba(255, 255, 255, 0.7);
    animation: none !important;
}

/* ================================================
   QUICK REPLIES
   ================================================ */
.quick-replies {
    padding: 10px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    background: var(--chat-bg);
    flex-shrink: 0;
    scrollbar-width: none;
}

.quick-replies::-webkit-scrollbar {
    display: none;
}

.quick-replies button {
    white-space: nowrap;
    background: var(--chat-surface-2) !important;
    border: 0 !important;
    color: var(--chat-text) !important;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease;
}

.quick-replies button:hover {
    background: var(--chat-surface-3) !important;
    color: #fff !important;
}

/* ================================================
   COMPOSER — Flutuante estilo WhatsApp
   Pílula arredondada com botão de enviar embutido
   ================================================ */
.inbox-chat .composer {
    padding: 10px 14px 14px;
    background: transparent;
    border: 0 !important;
    border-top: 0 !important;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Fundo da área do composer (sem borda visível, gradient sutil) */
.inbox-chat::after,
.inbox-chat::before {
    display: none;
}

.composer-action,
.inbox-chat .composer>button[type="button"] {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--chat-surface);
    color: var(--chat-text);
    border: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 120ms ease, color 120ms ease;
    align-self: flex-end;
    margin-bottom: 0;
}

.composer-action:hover,
.inbox-chat .composer>button[type="button"]:hover {
    background: var(--chat-surface-2);
    color: var(--chat-text);
}

.composer-action .material-symbols-rounded,
.composer-action .bi,
.inbox-chat .composer>button[type="button"] .material-symbols-rounded {
    font-size: 1.35rem !important;
    line-height: 1;
}

.chat-icon {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.chat-icon--plus {
    width: 1.35rem;
    height: 1.35rem;
}

/* Wrapper do input = pílula flutuante (sem borda/sombra de "separação") */
.composer-input-wrapper {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    background: var(--chat-surface);
    border-radius: 24px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0 !important;
    box-shadow: none !important;
    transition: background 120ms ease;
    position: relative;
    box-sizing: border-box;
}

.composer-input-wrapper:focus-within {
    background: var(--chat-surface-2);
}

/* Textarea autosize, SEM BORDA */
.inbox-chat .composer textarea,
.composer-input-wrapper textarea,
.inbox-chat .composer input[type="text"],
.composer-input-wrapper input[type="text"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--chat-text);
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.45;
    padding: 10px 0;
    margin: 0;
    resize: none;
    font-family: inherit;
    max-height: 140px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--chat-surface-3) transparent;
}

.composer-action--inside {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--chat-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
    padding: 0;
    margin: 0;
    line-height: 1;
    transition: all 120ms ease;
}

.composer-action--inside:hover {
    color: var(--chat-text);
    background: var(--chat-surface-2);
}

.inbox-chat .composer textarea::-webkit-scrollbar {
    width: 4px;
}

.inbox-chat .composer textarea::-webkit-scrollbar-thumb {
    background: var(--chat-surface-3);
    border-radius: 4px;
}

.inbox-chat .composer textarea:focus,
.composer-input-wrapper textarea:focus {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.inbox-chat .composer textarea::placeholder,
.inbox-chat .composer input[type="text"]::placeholder {
    color: var(--chat-text-dim);
    font-weight: 400;
}

.typing-indicator {
    position: absolute;
    bottom: -16px;
    left: 18px;
    font-size: 0.65rem;
    color: var(--chat-gold);
    font-weight: 700;
    pointer-events: none;
}

/* Botão de envio CIRCULAR DENTRO do wrapper */
.composer-input-wrapper .send-btn,
.inbox-chat .composer .send-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--chat-accent) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 120ms ease, transform 120ms ease;
    transform: none !important;
    align-self: center;
    margin-bottom: 0;
}

.composer-input-wrapper .send-btn:hover,
.inbox-chat .composer .send-btn:hover {
    background: var(--chat-accent-strong) !important;
    transform: none !important;
    box-shadow: none !important;
}

.composer-input-wrapper .send-btn:active,
.inbox-chat .composer .send-btn:active {
    background: var(--chat-accent-strong) !important;
    transform: scale(0.92) !important;
}

.composer-input-wrapper .send-btn .material-symbols-rounded,
.composer-input-wrapper .send-btn .bi {
    font-size: 1.15rem !important;
    color: #fff !important;
}

.composer-input-wrapper .send-btn .chat-icon {
    color: #fff;
}

/* ================================================
   COLUNA 3 — CONTEXTO (Perfil) — Estilo Premium
   ================================================ */
.inbox-context {
    border: 0 !important;
    border-left: 1px solid var(--chat-divider) !important;
    border-radius: 0 !important;
    box-shadow: none;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.context-panel__head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--chat-divider);
}

.context-panel__head h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--chat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.context-panel__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--chat-text-muted);
    border: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 140ms ease;
}

.context-panel__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.inbox-context__body {
    padding: 0 20px 24px;
}

/* Cabeçalho de Perfil Lateral */
.context-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
}

.context-profile .avatar-wrapper {
    width: 64px;
    height: 64px;
}

.context-profile__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 0;
}

.context-profile__info h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}

.profile-rating {
    margin-top: 4px;
    color: var(--chat-gold);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-rating .material-symbols-rounded {
    font-size: 1rem;
    font-variation-settings: 'FILL' 1;
}

/* Divisores e Seções */
.context-divider {
    height: 1px;
    background: var(--chat-divider);
    margin: 0 -20px;
    opacity: 0.5;
}

.context-section {
    padding: 24px 0;
}

.context-section__title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--chat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

/* Linhas de Métricas (Estilo Fiverr) */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--chat-text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 0.92rem;
    color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

#chat-client-status-text {
    color: var(--chat-success);
    font-weight: 800;
}

.sidebar-action {
    width: 100%;
    min-height: 48px;
    background: transparent;
    color: #ef4444;
    /* Vermelho para Denunciar */
    border: 1.5px solid rgba(239, 68, 68, 0.2) !important;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 140ms ease;
    font-family: inherit;
    margin-top: 8px;
}

.sidebar-report-link {
    background: transparent;
    border: none;
    color: var(--chat-text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    transition: color 140ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(255, 255, 255, 0.1);
}

.sidebar-report-link:hover {
    color: #ef4444;
    text-decoration-color: rgba(239, 68, 68, 0.3);
}

/* Subtle report icon in profile context (not the giant button) */
.sidebar-action-reporter {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    color: var(--chat-text-muted);
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, color 120ms ease;
    font-family: inherit;
    z-index: 2;
}

.sidebar-action-reporter:hover {
    background: var(--chat-surface-3);
    color: var(--chat-danger);
}

.sidebar-action-reporter .material-symbols-rounded {
    font-size: 1.15rem;
}

/* Sutil link de denúncia no contexto */
.sidebar-report-link {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    color: var(--chat-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: all 120ms ease;
    text-decoration: none;
    margin-top: 12px;
}

.sidebar-report-link:hover {
    background: var(--chat-surface-2);
    color: var(--chat-danger);
}


/* ================================================
   ESTADO VAZIO
   ================================================ */
.inbox-empty-view {
    background: var(--chat-bg);
    grid-column: 2 / -1;
    border: 0 !important;
}

@media (max-width: 1100px) {
    .inbox-empty-view {
        grid-column: 1 / -1;
    }
}

.empty-state-hero__icon {
    background: var(--chat-surface-2);
    border: 0 !important;
    color: var(--chat-accent);
    border-radius: 18px;
}

.empty-state-hero h2 {
    color: var(--chat-text);
}

.btn-action {
    background: var(--chat-accent) !important;
    color: #fff !important;
    border: 0 !important;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 700;
    transition: background 120ms ease !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-action:hover {
    background: var(--chat-accent-strong) !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-action--outline {
    background: var(--chat-surface-2) !important;
    color: var(--chat-text) !important;
    border: 0 !important;
}

.btn-action--outline:hover {
    background: var(--chat-surface-3) !important;
    border: 0 !important;
}

/* ================================================
   STATUS TAGS
   ================================================ */
.status-tag {
    background: var(--chat-accent) !important;
    color: #fff !important;
    border: 0 !important;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-tag--negotiating {
    background: var(--chat-accent) !important;
    color: #fff !important;
}

.status-tag--finished {
    background: var(--chat-success) !important;
    color: #fff !important;
}

.status-tag--rejected {
    background: var(--chat-danger) !important;
    color: #fff !important;
}

/* ================================================
   AUDIO RECORDER (sólido)
   ================================================ */
.audio-recorder-overlay {
    background: var(--chat-surface) !important;
    border: 0 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: none !important;
}

.audio-action-btn--cancel {
    background: var(--chat-surface-2) !important;
    color: var(--chat-danger) !important;
    border: 0 !important;
}

.audio-action-btn--cancel:hover {
    background: var(--chat-surface-3) !important;
    transform: none !important;
    box-shadow: none !important;
}

.audio-action-btn--send {
    background: var(--chat-accent) !important;
    color: #fff !important;
    border: 0 !important;
}

.audio-action-btn--send:hover:not(:disabled) {
    background: var(--chat-accent-strong) !important;
    transform: none !important;
    box-shadow: none !important;
}

.audio-preview {
    background: var(--chat-surface-2) !important;
    border: 0 !important;
}

.audio-preview .material-symbols-rounded {
    color: var(--chat-accent);
}

/* ================================================
   OVERLAY MOBILE (bottom sheet de contexto)
   ================================================ */
.context-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: none;
}

/* ================================================
   MSG CONTEXT MENU (long-press / right-click)
   ================================================ */
.msg-menu {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    background: #1a0e2e;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: menuPop 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: top left;
}

.msg-menu[hidden] {
    display: none;
}

@keyframes menuPop {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.msg-menu__item {
    background: transparent;
    border: 0;
    color: var(--chat-text);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    transition: background 100ms ease;
    font-family: inherit;
}

.msg-menu__item:hover {
    background: var(--chat-surface-3);
}

.msg-menu__item .material-symbols-rounded {
    font-size: 1.15rem;
    color: var(--chat-text-muted);
}

.msg-menu__item--danger {
    color: var(--chat-danger);
}

.msg-menu__item--danger .material-symbols-rounded {
    color: var(--chat-danger);
}

/* ================================================
   ANIMAÇÃO LIMPA — apenas fade-in sutil ao entrar
   ================================================ */
.bubble {
    animation: bubbleIn 140ms ease-out;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sem pulse no badge de não lidas — feio e distrai */
@keyframes badgePulse {

    0%,
    100% {
        transform: none;
    }
}

/* ================================================
   RESPONSIVO — MOBILE
   ================================================ */
@media (max-width: 1100px) {
    .inbox-app {
        height: calc(100dvh - 72px);
        grid-template-columns: 1fr;
    }

    /* Por padrão: lista. Quando abre conversa, esconde lista */
    .inbox-threads {
        border-right: 0 !important;
    }

    /* Por padrão no mobile: mostra lista, esconde conversa */
    .inbox-app .inbox-chat {
        display: none !important;
    }

    .inbox-app .inbox-threads {
        display: flex !important;
    }

    .inbox-app--mobile-list .inbox-chat,
    .inbox-app--mobile-list .inbox-context,
    .inbox-app--mobile-list .inbox-empty-view {
        display: none !important;
    }

    .inbox-app--conversation .inbox-threads,
    .inbox-app--conversation .inbox-empty-view {
        display: none !important;
    }

    /* Painel de contexto fica como bottom sheet — só aparece com .context-open */
    .inbox-app--conversation .inbox-context {
        display: none !important;
    }

    .inbox-app--conversation .inbox-chat {
        display: flex !important;
        height: 100%;
    }

    .negotiation-panel {
        padding: 10px 12px;
        gap: 10px;
        min-height: 60px;
        grid-template-columns: auto 1fr auto;
    }

    .chat-user-avatar {
        width: 40px;
        height: 40px;
    }

    .chat-user-details h4 {
        font-size: 0.93rem;
    }

    .chat-service-context {
        font-size: 0.72rem;
        gap: 6px;
    }

    /* No mobile não mostramos preço no header (vai pro contexto) */
    .negotiation-actions-desktop {
        display: none;
    }

    .negotiation-panel .chat-head__context-btn {
        grid-column: 3;
    }

    .inbox-chat .chat-body {
        padding: 14px 10px 4px;
    }

    .bubble {
        max-width: 84%;
        font-size: 0.92rem;
    }

    .inbox-chat .composer {
        padding: 8px 8px 10px;
        gap: 6px;
    }

    .composer-action,
    .inbox-chat .composer>button[type="button"] {
        width: 42px;
        height: 42px;
    }

    .composer-input-wrapper {
        min-height: 42px;
        padding: 4px 4px 4px 16px;
    }

    .composer-input-wrapper .send-btn,
    .inbox-chat .composer .send-btn {
        width: 34px !important;
        height: 34px !important;
    }

    /* Bottom sheet do contexto */
    body.context-open {
        overflow: hidden;
    }

    body.context-open .inbox-context {
        display: flex !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        z-index: 220 !important;
        width: 100% !important;
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        border-radius: 8px 8px 0 0 !important;
        border: 0 !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6) !important;
        padding: 18px 16px calc(18px + env(safe-area-inset-bottom)) !important;
        animation: sheetUp 200ms ease-out !important;
    }

    body.context-open .context-overlay {
        display: block !important;
        z-index: 210 !important;
    }

    @keyframes sheetUp {
        from {
            transform: translateY(20px);
            opacity: 0.8;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    body.context-open .context-overlay {
        display: block;
    }
}

/* Tablet */
@media (min-width: 1101px) and (max-width: 1300px) {
    :root {
        --inbox-sidebar-w: 280px;
        --inbox-context-w: 260px;
    }
}

/* Desktop largo */
@media (min-width: 1301px) {
    :root {
        --inbox-sidebar-w: 340px;
        --inbox-context-w: 300px;
    }
}

/* Quando user fecha contexto no desktop, expande chat */
@media (min-width: 1101px) {
    .inbox-app--no-context {
        grid-template-columns: var(--inbox-sidebar-w) 1fr 0;
    }
}

.context-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.context-panel__head h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ================================================
   NEGOTIATION BAR — Expansível abaixo do header
   ================================================ */
.nego-bar {
    background: var(--chat-surface);
    border-bottom: 1px solid var(--chat-divider);
    flex-shrink: 0;
    overflow: hidden;
}

.nego-bar__head {
    width: 100%;
    min-width: 0;
    background: transparent;
    border: 0;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--chat-text);
    text-align: left;
    font-family: inherit;
    transition: background 120ms ease;
}

.nego-bar__head:hover {
    background: var(--chat-surface-2);
}

.nego-bar__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chat-surface-3);
    color: var(--chat-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nego-bar__head-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-right: 8px;
    min-width: 0;
}

.nego-bar__head-actions .nego-bar__action {
    height: 32px;
    padding: 0 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 99px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 120ms ease;
    border: 1.5px solid var(--chat-accent);
}

.nego-bar__action--primary {
    background: var(--chat-accent);
    color: #fff;
}

.nego-bar__action--outline {
    background: transparent;
    color: var(--chat-accent);
}

.nego-bar__icon .material-symbols-rounded {
    font-size: 1.15rem;
}

.nego-bar__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nego-bar__title strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--chat-text);
    line-height: 1.2;
}

.nego-bar__title span {
    font-size: 0.74rem;
    color: var(--chat-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nego-bar__chevron {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--chat-text-muted);
    transition: transform 200ms ease;
    flex-shrink: 0;
}

.nego-bar__chevron .material-symbols-rounded {
    font-size: 1.2rem;
}

.nego-bar--expanded .nego-bar__chevron {
    transform: rotate(180deg);
}

@media (max-width: 600px) {
    .nego-bar__head {
        padding: 10px 14px;
        gap: 8px;
    }
}

.nego-bar__body {
    padding: 12px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: negoOpen 180ms ease-out;
}

.nego-bar__body[hidden] {
    display: none;
}

@keyframes negoOpen {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nego-bar__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--chat-bg);
    border-radius: 10px;
    font-size: 0.86rem;
}

.nego-bar__label {
    color: var(--chat-text-muted);
    font-weight: 600;
}

.nego-bar__price {
    color: var(--chat-gold);
    font-size: 0.95rem;
    font-weight: 800;
}

.nego-bar__actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.nego-bar__action {
    flex: 1;
    width: 100%;
    min-height: 44px;
    height: auto;
    border: 0;
    border-radius: 12px;
    background: var(--chat-surface-2);
    color: var(--chat-text);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    gap: 8px;
    transition: all 120ms ease;
    font-family: inherit;
    line-height: 1.2;
}

.nego-bar__action:hover {
    background: var(--chat-surface-3);
}

.nego-bar__action--primary {
    background: var(--chat-accent);
    color: #fff;
}

.nego-bar__action--primary:hover {
    background: var(--chat-accent-strong);
}

.nego-bar__action .material-symbols-rounded {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nego-bar__action:disabled {
    cursor: default;
    opacity: 0.74;
}

/* ================================================
   ATTACH MENU (+) — popover acima do botão
   ================================================ */
.attach-menu {
    position: fixed;
    z-index: 9990;
    background: var(--chat-surface);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
    animation: menuPop 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom left;
}

.attach-menu[hidden] {
    display: none;
}

.attach-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--chat-text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 120ms ease;
}

.attach-menu__item:hover {
    background: var(--chat-surface-2);
}

.attach-menu__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attach-menu__icon .material-symbols-rounded {
    font-size: 1.2rem;
    color: #fff;
}

.attach-menu__icon--image {
    background: #2563eb;
}

.attach-menu__icon--location {
    background: #16a34a;
}

.attach-menu__icon--proposal {
    background: var(--chat-accent);
}

.composer-action--open {
    background: var(--chat-surface-2) !important;
    color: var(--chat-accent) !important;
}

.composer-action--open .material-symbols-rounded {
    transform: rotate(45deg);
    transition: transform 200ms ease;
}

.composer-action--inside .material-symbols-rounded {
    display: block;
    line-height: 1;
}

/* ================================================
   PROPOSAL CARD — Rico, expansível, com botão de pagar
   ================================================ */
.bubble--offer {
    max-width: min(430px, 92%) !important;
    width: auto !important;
    min-width: min(300px, 92%);
    background: var(--chat-surface-2) !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 0 !important;
    margin: 6px 0 !important;
    display: flex !important;
    flex-direction: column;
    gap: 0;
    box-shadow: none !important;
    animation: bubbleIn 180ms ease-out;
    cursor: default;
}

.bubble--offer--in {
    align-self: flex-start !important;
}

.bubble--offer--out {
    align-self: flex-end !important;
}

.bubble--offer::before {
    display: none !important;
}

.bubble--offer__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 14px 12px;
    background: var(--chat-surface-3);
}

.bubble--offer__head-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.bubble--offer__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    background: var(--chat-accent);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bubble--offer__tag .material-symbols-rounded {
    font-size: 0.95rem;
}

.bubble--offer__title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--chat-text);
    line-height: 1.3;
    word-wrap: break-word;
}

.bubble--offer__price {
    text-align: right;
    flex-shrink: 0;
    min-width: 0;
}

.bubble--offer__price span {
    display: block;
    font-size: 0.66rem;
    color: var(--chat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.bubble--offer__price strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--chat-gold);
    line-height: 1.1;
    margin-top: 2px;
    letter-spacing: 0;
    white-space: nowrap;
}

.bubble--offer__text {
    padding: 12px 14px 14px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.bubble--offer__milestones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 14px 14px;
}

.bubble--offer__milestone {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid var(--chat-divider);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
    color: var(--chat-text);
}

.bubble--offer__milestone span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bubble--offer__milestone strong {
    flex-shrink: 0;
    color: var(--chat-gold);
    font-weight: 800;
}

.bubble--offer__deadline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px 13px;
    font-size: 0.78rem;
    color: var(--chat-text-muted);
    font-weight: 700;
}

.bubble--offer__deadline .material-symbols-rounded {
    font-size: 1rem;
    color: var(--chat-gold);
}

.bubble--offer__footer {
    padding: 16px 14px;
    border-top: 1px solid var(--chat-divider);
}

.bubble--offer__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--chat-text-muted);
}

.bubble--offer__status .material-symbols-rounded {
    font-size: 1.15rem;
}

.bubble--offer__status--accepted {
    color: var(--chat-success);
}

.bubble--offer__status--rejected {
    color: var(--chat-danger);
}

.btn-pay {
    width: 100%;
    min-height: 44px;
    background: var(--chat-accent) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 18px;
    transition: background 120ms ease;
    box-shadow: none !important;
    font-family: inherit;
}

.btn-pay:hover {
    background: var(--chat-accent-strong) !important;
}

.btn-pay:active {
    transform: none;
}

.btn-pay .material-symbols-rounded {
    font-size: 1.2rem;
}

/* ================================================
   LOCATION CARD
   ================================================ */
.bubble--location {
    padding: 0 !important;
    overflow: hidden;
    max-width: min(360px, 92%) !important;
    min-width: min(280px, 92%);
    background: var(--chat-surface-2) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    animation: bubbleIn 140ms ease-out;
    display: flex !important;
    flex-direction: column;
    gap: 0 !important;
}

.bubble--location::before {
    display: none !important;
}

.bubble--location__map {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #d7dde5;
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    padding: 0;
    display: block;
    font-family: inherit;
}

.bubble--location__tile-layer {
    position: absolute;
    width: 768px;
    height: 768px;
    left: calc(50% - var(--tile-offset-x) - 256px);
    top: calc(50% - var(--tile-offset-y) - 256px);
}

.bubble--location__tile {
    position: absolute;
    width: 256px;
    height: 256px;
    object-fit: cover;
    display: block;
}

.bubble--location__marker {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -92%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--chat-danger);
    font-size: 2.1rem !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.bubble--location__source {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.2;
    pointer-events: none;
}

.bubble--location__info {
    padding: 12px 12px 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bubble--location__info .material-symbols-rounded {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--chat-surface-3);
    color: var(--chat-gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.bubble--location__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.bubble--location__label {
    color: var(--chat-text);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.25;
}

.bubble--location__accuracy {
    color: var(--chat-text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.25;
}

.bubble--location__open {
    margin: 2px 12px 10px;
    width: calc(100% - 24px);
    min-height: 38px;
    background: var(--chat-accent) !important;
    color: #fff !important;
    border: 0;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 120ms ease;
    font-family: inherit;
}

.bubble--out .bubble--location__open {
    background: var(--chat-accent) !important;
}

.bubble--location__open:hover {
    background: var(--chat-accent-strong) !important;
}

.bubble--location__open .material-symbols-rounded {
    font-size: 1rem;
    color: #fff !important;
}

.bubble--location__time {
    align-self: flex-end;
    padding: 0 12px 8px;
    font-size: 0.66rem;
    color: var(--chat-text-muted);
    font-weight: 500;
}

@media (max-width: 560px) {

    .bubble--offer,
    .bubble--location {
        max-width: 96% !important;
        width: 96% !important;
        min-width: 0;
    }

    .bubble--offer__head {
        flex-direction: column-reverse;
        gap: 10px;
        padding: 13px 13px 12px;
    }

    .bubble--offer__price {
        text-align: left !important;
        width: 100%;
        padding-top: 2px;
        border-top: 1px solid var(--chat-divider);
    }

    .bubble--offer__price span {
        font-size: 0.62rem;
    }

    .bubble--offer__price strong {
        font-size: 1.45rem;
        white-space: normal;
    }

    .bubble--offer__tag {
        max-width: 100%;
        font-size: 0.61rem;
        padding: 4px 8px;
    }

    .bubble--offer__title {
        font-size: 0.96rem;
    }

    .bubble--location__open {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
    }
}

/* ================================================
   MODAL (confirmação + formulários)
   ================================================ */
.chat-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: overlayIn 160ms ease-out;
}

.chat-modal__overlay--closing {
    animation: overlayOut 160ms ease-in forwards;
}

@keyframes overlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes overlayOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.chat-modal {
    background: var(--chat-surface);
    border-radius: 8px;
    width: 100%;
    max-width: min(460px, calc(100vw - 24px));
    max-height: 90vh;
    overflow-x: hidden;
    overflow-y: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: modalIn 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--chat-text);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 12px;
    flex-shrink: 0;
}

.chat-modal__header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--chat-text);
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
    letter-spacing: -0.015em;
    overflow-wrap: break-word;
}

.chat-modal__close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    color: var(--chat-text-muted);
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease;
    flex-shrink: 0;
}

.chat-modal__close:hover {
    background: var(--chat-surface-2);
    color: #fff;
}

.chat-modal__close .material-symbols-rounded {
    font-size: 1.2rem;
}

.chat-modal__body {
    padding: 0 20px 16px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 auto;
}

.chat-modal__text {
    margin: 0 0 10px;
}

.chat-modal__text--muted {
    font-size: 0.82rem;
    color: var(--chat-text-muted);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.chat-modal__text--muted .material-symbols-rounded {
    font-size: 1.05rem;
    color: var(--chat-gold);
    flex-shrink: 0;
    margin-top: 1px;
}

.chat-modal__actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px 18px;
    border-top: 1px solid var(--chat-divider);
    flex-shrink: 0;
}

.chat-modal__btn {
    flex: 1 0 0;
    min-width: 0;
    min-height: 48px;
    height: 48px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 120ms ease, filter 120ms ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    padding: 0 14px;
}

.chat-modal__btn:disabled {
    cursor: wait;
    opacity: 0.68;
}

.chat-modal__btn--secondary {
    background: var(--chat-surface-2);
    color: var(--chat-text);
}

.chat-modal__btn--secondary:hover {
    background: var(--chat-surface-3);
}

.chat-modal__btn--primary {
    background: var(--chat-accent);
    color: #fff;
}

.chat-modal__btn--primary:hover {
    background: var(--chat-accent-strong);
}

.chat-modal__btn--danger {
    background: var(--chat-danger);
}

.chat-modal__btn--danger:hover {
    filter: brightness(1.1);
}

/* Proposal form */
.proposal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.proposal-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.proposal-form__field>span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--chat-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.proposal-form__field>span small {
    font-weight: 500;
    color: var(--chat-text-muted);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

.proposal-form__field input,
.proposal-form__field textarea {
    background: var(--chat-bg);
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--chat-text);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    min-height: 44px;
    transition: background 120ms ease;
}

.proposal-form__field input:focus,
.proposal-form__field textarea:focus {
    background: var(--chat-surface-2);
}

.proposal-form__price {
    display: flex;
    align-items: stretch;
    background: var(--chat-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: background 120ms ease;
}

.proposal-form__price:focus-within {
    background: var(--chat-surface-2);
}

.proposal-form__currency {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    font-weight: 800;
    color: var(--chat-gold);
    font-size: 1rem;
    background: rgba(252, 196, 25, 0.08);
}

.proposal-form__price input {
    flex: 1;
    background: transparent !important;
    padding: 12px 14px;
    font-size: 1.1rem !important;
    font-weight: 700;
}

.proposal-form__hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--chat-text-muted);
    margin: 4px 0 0;
    line-height: 1.4;
}

.proposal-form__hint .material-symbols-rounded {
    font-size: 1rem;
    color: var(--chat-gold);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ================================================
   REMOÇÃO DE ESTILOS INLINE (JS -> CSS)
   ================================================ */

/* Indicador de Digitação */
.typing-dots-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--chat-surface-2);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.typing-dots-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--chat-text-muted);
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out;
}

/* Botão de Localização */
.bubble--location__open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1;
    background: var(--chat-accent);
    border: 0;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.bubble--location__open .material-symbols-rounded {
    font-size: 1rem;
    color: #fff;
}

/* Modal de Pagamento V2 */
.trampix-modal-v2 {
    font-family: inherit;
    color: var(--chat-text);
    max-width: 100%;
    overflow-x: hidden;
}

.payment-header {
    margin-bottom: 24px;
}

.payment-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.payment-professional {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    background: var(--chat-surface-2);
    padding: 12px;
    border-radius: 12px;
}

.payment-professional img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.payment-professional strong {
    display: block;
    font-size: 0.95rem;
}

.payment-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--chat-gold);
}

.payment-divider {
    width: 100%;
    height: 1px;
    background: var(--chat-divider);
    margin: 16px 0;
}

.payment-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.payment-step {
    display: flex;
    gap: 12px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.payment-step .material-symbols-rounded {
    font-size: 1.2rem;
}

.payment-step--success .material-symbols-rounded {
    color: var(--chat-success);
}

.payment-step--accent .material-symbols-rounded {
    color: var(--chat-accent);
}

.payment-summary {
    background: var(--chat-surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid var(--chat-divider);
}

.payment-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.88rem;
}

.payment-summary-row--muted {
    color: var(--chat-text-muted);
}

.payment-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--chat-divider);
}

.payment-summary-total strong:first-child {
    font-size: 0.95rem;
}

.payment-summary-total strong:last-child {
    font-size: 1.35rem;
    color: #fff;
}

/* Checkbox Warnings */
.warning-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--chat-text-muted);
    line-height: 1.4;
}

.warning-checkbox {
    margin-top: 2px;
    accent-color: var(--chat-accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Link Externo Bubble */
.external-link-preview {
    background: var(--chat-bg);
    padding: 10px 14px;
    border-radius: 8px;
    word-break: break-all;
    font-size: 0.85rem;
    margin: 8px 0;
}

/* ================================================
   FIXES DE LAYOUT MOBILE
   ================================================ */
@media (max-width: 1100px) {

    /* Garante que o composer não cubra a última mensagem e respeite a safe area */
    .inbox-chat {
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Ajuste de padding no corpo do chat para mobile */
    .inbox-chat .chat-body {
        padding-bottom: 20px;
    }

    /* Ajuste no nego-bar para mobile para não empilhar feio */
    .nego-bar__head {
        padding: 10px 16px;
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }

    .nego-bar__icon {
        align-self: center;
    }

    .nego-bar__title {
        align-self: center;
    }


    .nego-bar__desc {
        font-size: 0.8rem;
        padding: 0 16px 12px;
    }
}

/* ================================================
   ATTACH MENU
   ================================================ */
.attach-menu {
    position: fixed;
    z-index: 10000;
    background: var(--chat-surface-2);
    border: 1.5px solid var(--chat-divider);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 190px;
    animation: menuPop 140ms ease-out;
}

.attach-menu[hidden] {
    display: none;
}

.attach-menu__item {
    background: transparent;
    border: 0;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--chat-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.attach-menu__item:hover {
    background: var(--chat-surface-3);
}

.attach-menu__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attach-menu__icon .material-symbols-rounded {
    font-size: 1.2rem;
}

.attach-menu__icon--image {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.attach-menu__icon--location {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.attach-menu__icon--proposal {
    background: rgba(252, 196, 25, 0.1);
    color: var(--chat-gold);
}

/* Ajustes Mobile Adicionais */
@media (max-width: 1100px) {
    .inbox-threads .search-field {
        height: 48px;
        margin-top: 12px !important;
    }

    /* Esconde elementos desnecessários no mobile segundo pedido do usuário */
    .nego-bar__chevron,
    #nego-bar-body {
        display: none !important;
    }

    /* Remove o ponteiro de expansão já que não expande mais no mobile */
    .nego-bar__head {
        cursor: pointer;
    }
}

.status-dot {
    width: 11px;
    height: 11px;
    border-width: 1.5px;
}

/* ================================================
   FLUXO DE PROPOSTAS (Fiverr Style)
   ================================================ */
.proposal-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
    max-width: 100%;
    overflow-x: hidden;
}

.proposal-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--chat-surface-2);
    border: 1.5px solid var(--chat-divider);
    border-radius: 12px;
    cursor: pointer;
    transition: all 180ms ease;
    text-align: left;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.proposal-option:hover {
    border-color: var(--chat-accent);
    background: var(--chat-surface-3);
}

.proposal-option__icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(138, 5, 190, 0.1);
    color: var(--chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.proposal-option__icon span {
    font-size: 24px;
}

.proposal-option__text {
    flex: 1;
    min-width: 0;
}

.proposal-option__text strong {
    display: block;
    font-size: 1rem;
    color: var(--chat-text);
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.proposal-option__text p {
    font-size: 0.85rem;
    color: var(--chat-text-muted);
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 560px) {
    .chat-modal__overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .chat-modal {
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
    }

    .chat-modal__header,
    .chat-modal__body,
    .chat-modal__actions {
        padding-left: 14px;
        padding-right: 14px;
    }

    .chat-modal__actions {
        flex-direction: column-reverse;
    }

    .proposal-option {
        gap: 12px;
        padding: 14px;
        align-items: flex-start;
    }

    .proposal-option__icon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }
}

/* Formulário de contrato */
.proposal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.proposal-form__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proposal-form__field span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--chat-text-muted);
}

.proposal-form input,
.proposal-form textarea {
    background: var(--chat-bg);
    border: 1.5px solid var(--chat-divider);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--chat-text);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 140ms ease;
}

.proposal-form input:focus,
.proposal-form textarea:focus {
    border-color: var(--chat-accent);
}

.proposal-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Milestones List */
.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.milestone-item {
    background: var(--chat-surface-2);
    padding: 12px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 100px auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--chat-divider);
}

.milestone-item input {
    padding: 8px 10px;
    font-size: 0.85rem;
}

.milestone-item .btn-icon {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--chat-danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.milestone-item .btn-icon:disabled {
    cursor: not-allowed;
    opacity: 0.36;
}

.btn-add-milestone {
    background: none;
    border: 1.5px dashed var(--chat-divider);
    color: var(--chat-accent);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 140ms ease;
}

.btn-add-milestone:hover {
    border-color: var(--chat-accent);
    background: rgba(138, 5, 190, 0.05);
}

.proposal-form__hint {
    display: flex;
    gap: 8px;
    background: rgba(252, 196, 25, 0.05);
    border-radius: 8px;
    padding: 10px;
    color: var(--chat-highlight);
    font-size: 0.8rem;
    align-items: flex-start;
}

.proposal-form__hint span:first-child {
    font-size: 18px;
    margin-top: 2px;
}

@media (max-width: 560px) {
    .chat-modal__overlay {
        padding: 16px;
        align-items: center;
    }

    .chat-modal {
        max-width: calc(100vw - 32px);
        max-height: calc(100dvh - 32px);
        border-radius: 20px;
    }

    .chat-modal__header {
        padding: 18px 14px 10px;
    }

    .chat-modal__header h3 {
        font-size: 1rem;
        line-height: 1.25;
    }

    .chat-modal__body {
        padding: 0 14px 12px;
    }

    .chat-modal__actions {
        flex-direction: column-reverse;
        gap: 10px;
        padding: 10px 14px 14px;
        background: var(--chat-surface);
    }

    .chat-modal__btn {
        flex: none;
        width: 100%;
        min-height: 50px;
        height: 50px;
        font-size: 0.92rem;
        border-radius: 12px;
    }

    .proposal-form {
        gap: 12px;
    }

    .proposal-form__field {
        gap: 7px;
    }

    .proposal-form input,
    .proposal-form textarea {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .proposal-form input {
        min-height: 44px;
    }

    .proposal-form textarea {
        min-height: 96px;
    }

    .proposal-form__row,
    .milestone-item {
        grid-template-columns: 1fr;
    }

    .milestone-item {
        padding: 10px;
    }

    .milestone-item input {
        min-height: 42px;
    }

    .btn-add-milestone {
        min-height: 44px;
        padding: 0 12px;
    }

    .proposal-form__hint {
        padding: 12px;
    }
}

/* Ajustes finais de mobile: evita cortes horizontais em contrato e negociação */
.chat-modal__header {
    width: 100%;
    box-sizing: border-box;
}

.chat-modal__header h3 {
    flex: 1 1 auto;
}

.chat-modal__btn {
    min-height: 50px;
}

@media (max-width: 1100px) {
    /* No mobile, o nego-bar vira coluna para não sobrepor conteúdo */
    .nego-bar__head {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 16px;
    }

    /* Linha superior: ícone + título */
    .nego-bar__head > .nego-bar__icon,
    .nego-bar__head > .nego-bar__title {
        display: flex;
    }

    /* Esconde chevron no mobile */
    .nego-bar__head > .nego-bar__chevron {
        display: none !important;
    }

    /* Linha do título fica em row */
    .nego-bar__head {
        flex-direction: column;
    }

    /* Cria uma linha interna para ícone + título */
    .nego-bar__head > .nego-bar__icon {
        display: none;
    }

    /* Se for PRESTADOR: esconde o preço e foca no botão */
    .nego-bar[data-viewer="provider"] .nego-bar__icon,
    .nego-bar[data-viewer="provider"] .nego-bar__title,
    .nego-bar[data-viewer="provider"] .nego-bar__chevron {
        display: none !important;
    }

    .nego-bar[data-viewer="provider"] .nego-bar__head {
        padding: 12px;
    }

    /* Título do cliente */
    .nego-bar__title {
        flex: unset;
        align-items: flex-start;
        text-align: left;
        min-width: 0;
    }

    /* Ações ficam abaixo do título, largura total */
    .nego-bar__head-actions {
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: stretch;
    }

    /* Botão ocupa toda a largura */
    .nego-bar__action {
        height: 48px;
        min-height: 48px;
        padding: 0 20px;
        font-size: 0.95rem;
        border-radius: 12px;
        white-space: nowrap;
        width: 100%;
        flex: 1;
    }
}

@media (max-width: 560px) {

    .bubble--offer,
    .bubble--location {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .bubble--offer__head {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .bubble--offer__price {
        text-align: left !important;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid var(--chat-divider);
    }

    .bubble--offer__milestone {
        display: grid;
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .bubble--offer__milestone strong {
        justify-self: start;
    }

    .chat-modal__btn {
        min-height: 52px;
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        font-weight: 800;
    }
}


/* ================================================
   REPLY UI
   ================================================ */
.reply-preview {
    background: var(--chat-surface-2);
    border-top: 1px solid var(--chat-divider);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInUp 200ms ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.reply-preview__content {
    flex: 1;
    min-width: 0;
    border-left: 3px solid var(--chat-accent);
    padding-left: 10px;
}

.reply-preview__user {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--chat-accent);
    margin-bottom: 2px;
}

.reply-preview__text {
    display: block;
    font-size: 0.8rem;
    color: var(--chat-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview__close {
    background: transparent;
    border: 0;
    color: var(--chat-text-muted);
    cursor: pointer;
    display: flex;
    padding: 4px;
}

.bubble__quote {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.11);
    border-left: 3px solid var(--chat-accent);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 120ms ease;
}

.bubble--out .bubble__quote {
    background: rgba(12, 4, 22, 0.28);
}

.bubble--out .bubble__quote-user {
    color: rgba(255, 255, 255, 0.9);
}

.bubble:has(.bubble__quote) {
    min-width: min(320px, 82vw);
}

.bubble__quote:hover {
    background: rgba(255, 255, 255, 0.16);
}

.bubble__quote-user {
    display: block;
    font-weight: 800;
    font-size: 0.78rem;
    color: var(--chat-accent);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.bubble__quote-text {
    width: 100%;
    max-width: 100%;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.4;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Flash animation for scrolling to message */
@keyframes flash-message {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: var(--chat-accent-faint);
    }

    100% {
        background-color: transparent;
    }
}

.bubble--flash {
    animation: flash-message 1s ease-out;
}

/* ================================================
   DISPUTE CENTER — Central de Resolução
   ================================================ */
.dispute-center, .dispute-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.dispute-intro {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: rgba(138, 5, 190, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(138, 5, 190, 0.2);
}

.dispute-intro .material-symbols-rounded {
    font-size: 2rem;
    color: var(--chat-accent);
}

.dispute-intro h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: var(--chat-text);
}

.dispute-intro p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--chat-text-muted);
}

.dispute-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dispute-form .form-label {
    color: var(--chat-text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dispute-form .form-input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: var(--chat-bg);
    color: var(--chat-text);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.35;
    outline: none;
    padding: 11px 12px;
    box-sizing: border-box;
}

.dispute-form textarea.form-input {
    min-height: 96px;
    resize: vertical;
}

.dispute-form select.form-input {
    appearance: none;
    cursor: pointer;
}

.dispute-form .form-input::placeholder {
    color: var(--chat-text-dim);
}

.dispute-form .form-input:focus {
    border-color: rgba(138, 5, 190, 0.65);
    box-shadow: 0 0 0 3px rgba(138, 5, 190, 0.18);
}

.input-with-prefix {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: var(--chat-bg);
    padding: 0 12px;
}

.input-with-prefix:focus-within {
    border-color: rgba(138, 5, 190, 0.65);
    box-shadow: 0 0 0 3px rgba(138, 5, 190, 0.18);
}

.input-with-prefix > span {
    color: var(--chat-gold);
    font-size: 0.82rem;
    font-weight: 800;
}

.input-with-prefix .form-input {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}

.input-with-prefix .form-input:focus {
    border: 0;
    box-shadow: none;
}

.dispute-status-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.dispute-status--open { background: #3b82f6; color: #fff; }
.dispute-status--accepted { background: #22c55e; color: #fff; }
.dispute-status--escalated { background: #ef4444; color: #fff; }

.dispute-details {
    padding: 16px;
    background: var(--chat-surface-2);
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.dispute-details p { margin: 8px 0; }
.dispute-details strong { color: var(--chat-text-muted); }

.dispute-btns {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.dispute-wait-msg {
    padding: 16px;
    text-align: center;
    color: var(--chat-text-muted);
    font-style: italic;
    background: var(--chat-surface-2);
    border-radius: 8px;
}

.alert-red {
    color: #ef4444;
    font-weight: 600;
    font-style: normal;
}

/* Mobile final override: negotiation bar compacta e previsivel */
@media (max-width: 700px) {
    .nego-bar__head {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        padding: 8px 12px !important;
    }

    .nego-bar__icon,
    .nego-bar__chevron {
        display: none !important;
    }

    .nego-bar__title {
        display: flex !important;
        flex-direction: row !important;
        align-items: baseline;
        gap: 6px;
        min-width: 0;
    }

    .nego-bar__title strong {
        font-size: 0.82rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nego-bar__title span {
        font-size: 0.72rem;
        color: var(--chat-text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nego-bar__head-actions {
        width: 100% !important;
        display: flex !important;
    }

    .nego-bar__head-actions .nego-bar__action,
    .nego-bar__action {
        flex: 1 !important;
        width: 100% !important;
        min-height: 40px !important;
        height: 40px !important;
        padding: 0 12px !important;
        border-radius: 10px !important;
        font-size: 0.82rem !important;
        justify-content: center;
    }

    .nego-bar__action .material-symbols-rounded {
        font-size: 1rem !important;
    }
}
