*{
    box-sizing:border-box;
}

:root{
    --bg:#09080d;
    --panel:#111015;
    --panel2:#18161d;
    --line:rgba(255,255,255,.10);
    --text:#ffffff;
    --muted:#b9b5c1;
    --champagne:#eadfcf;
    --gold:#d4af37;
    --blue:#1976ff;
    --success:#72e6a6;
    --danger:#ff7d91;
}

html,
body{
    width:100%;
    min-height:100%;
    margin:0;
}

body{
    font-family:"Outfit",sans-serif;
    background:
        radial-gradient(circle at 10% 0%,rgba(106,82,255,.10),transparent 26%),
        linear-gradient(180deg,#08070b,#100d13);
    color:var(--text);
    -webkit-font-smoothing:antialiased;
}

button,
textarea{
    font:inherit;
}

button{
    -webkit-tap-highlight-color:transparent;
}

.chat-app{
    width:min(100%,860px);
    min-height:100vh;
    margin:0 auto;
    background:rgba(7,7,10,.72);
    border-left:1px solid var(--line);
    border-right:1px solid var(--line);
}

.chat-header{
    position:sticky;
    top:0;
    z-index:50;
    min-height:74px;
    display:grid;
    grid-template-columns:44px 46px minmax(0,1fr) 44px;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    background:rgba(8,7,11,.94);
    border-bottom:1px solid var(--line);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
}

.icon-btn{
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:#fff;
    cursor:pointer;
}

.support-avatar{
    position:relative;
    width:44px;
    height:44px;
    display:grid;
    place-items:center;
    border:1px solid rgba(234,223,207,.28);
    background:
        linear-gradient(135deg,rgba(234,223,207,.16),rgba(255,255,255,.035));
    color:var(--champagne);
    font-size:18px;
    font-weight:800;
}

.online-dot{
    position:absolute;
    right:-2px;
    bottom:-2px;
    width:12px;
    height:12px;
    border:2px solid #09080d;
    border-radius:50%;
    background:var(--success);
}

.support-info{
    min-width:0;
}

.support-info h1{
    margin:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#fff;
    font-size:16px;
    font-weight:800;
}

.support-info p{
    margin:3px 0 0;
    display:flex;
    align-items:center;
    gap:6px;
    color:#c7c2cc;
    font-size:11px;
}

.status-dot{
    width:6px;
    height:6px;
    border-radius:50%;
    background:var(--success);
}

.chat-main{
    min-height:calc(100vh - 160px);
    padding:18px 14px 124px;
}

.welcome-card{
    padding:22px 18px;
    margin-bottom:18px;
    border:1px solid rgba(234,223,207,.19);
    background:
        radial-gradient(circle at 90% 10%,rgba(212,175,55,.08),transparent 32%),
        rgba(255,255,255,.035);
}

.welcome-icon{
    width:46px;
    height:46px;
    display:grid;
    place-items:center;
    margin-bottom:16px;
    border:1px solid rgba(234,223,207,.25);
    color:var(--champagne);
    background:rgba(234,223,207,.06);
}

.welcome-eyebrow{
    display:block;
    margin-bottom:8px;
    color:var(--gold);
    font-size:9px;
    font-weight:800;
    letter-spacing:1.8px;
}

.welcome-card h2{
    margin:0 0 8px;
    color:#fff;
    font-size:21px;
    line-height:1.2;
}

.welcome-card p{
    margin:0;
    color:#d2ced7;
    font-size:13px;
    line-height:1.7;
}

.welcome-points{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:16px;
}

.welcome-points span{
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:8px 9px;
    border:1px solid var(--line);
    color:#d8d4dc;
    background:rgba(255,255,255,.025);
    font-size:10px;
}

.welcome-points i{
    color:var(--champagne);
}

.conversation-date{
    display:flex;
    align-items:center;
    gap:10px;
    margin:16px 0;
    color:#96919e;
    font-size:10px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:1px;
}

.conversation-date::before,
.conversation-date::after{
    content:"";
    height:1px;
    flex:1;
    background:var(--line);
}

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

.loading-state,
.empty-state{
    padding:28px 15px;
    text-align:center;
    color:#aaa5b2;
    font-size:12px;
}

.loading-state i{
    margin-right:6px;
}

.message-row{
    display:flex;
    width:100%;
}

.message-row.mine{
    justify-content:flex-end;
}

.message-row.theirs{
    justify-content:flex-start;
}

.message-bubble{
    width:fit-content;
    max-width:min(82%,560px);
    padding:10px 12px 7px;
    border:1px solid var(--line);
    background:#17151b;
}

.message-row.mine .message-bubble{
    background:#f3eee7;
    border-color:#f3eee7;
    color:#111;
}

.message-row.theirs .message-bubble{
    background:#17151b;
    color:#fff;
}

.message-text{
    margin:0;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    font-size:13px;
    line-height:1.5;
}

.message-meta{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:6px;
    margin-top:5px;
    color:#98929e;
    font-size:9px;
}

.message-row.mine .message-meta{
    color:#68636c;
}

.system-message{
    align-self:center;
    max-width:88%;
    padding:8px 11px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.025);
    color:#aaa5b0;
    text-align:center;
    font-size:10px;
    line-height:1.5;
}

.composer{
    position:fixed;
    left:50%;
    bottom:0;
    z-index:60;
    width:min(100%,860px);
    transform:translateX(-50%);
    padding:10px 12px calc(10px + env(safe-area-inset-bottom));
    background:rgba(10,9,13,.96);
    border-top:1px solid var(--line);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
}

.message-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) 48px;
    align-items:end;
    gap:8px;
}

.message-form textarea{
    width:100%;
    min-height:48px;
    max-height:130px;
    resize:none;
    padding:13px 14px;
    border:1px solid var(--line);
    border-radius:0;
    outline:none;
    background:#17151b;
    color:#fff;
    caret-color:#fff;
    line-height:1.4;
}

.message-form textarea::placeholder{
    color:#88838f;
}

.message-form textarea:focus{
    border-color:rgba(234,223,207,.40);
}

.send-btn{
    width:48px;
    height:48px;
    display:grid;
    place-items:center;
    border:1px solid #fff;
    border-radius:0;
    background:#fff;
    color:#111;
    cursor:pointer;
}

.send-btn:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.composer-note{
    margin-top:7px;
    color:#807b87;
    text-align:center;
    font-size:8.5px;
}

.toast{
    position:fixed;
    left:50%;
    bottom:100px;
    z-index:200;
    width:min(calc(100% - 28px),430px);
    padding:12px 14px;
    transform:translate(-50%,20px);
    border:1px solid var(--line);
    background:#19171d;
    color:#fff;
    opacity:0;
    pointer-events:none;
    transition:.2s ease;
    font-size:12px;
}

.toast.show{
    opacity:1;
    transform:translate(-50%,0);
}

@media(max-width:600px){

    .chat-app{
        border:0;
    }

    .chat-header{
        grid-template-columns:40px 42px minmax(0,1fr) 40px;
        min-height:68px;
        padding:8px 10px;
    }

    .icon-btn{
        width:38px;
        height:38px;
    }

    .support-avatar{
        width:40px;
        height:40px;
    }

    .support-info h1{
        font-size:14px;
    }

    .chat-main{
        padding:14px 10px 124px;
    }

    .welcome-card{
        padding:19px 15px;
    }

    .message-bubble{
        max-width:86%;
    }

    .composer{
        padding-left:10px;
        padding-right:10px;
    }
}
