* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; background: #111b21; color: #e9edef; }
body { display: flex; font-size: 14px; }
aside { width: 320px; min-width: 260px; background: #111b21; border-right: 1px solid #222d34; display: flex; flex-direction: column; height: 100%; }
.bar { height: 54px; background: #202c33; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #222d34; flex-shrink: 0; }
.info-banner { background: #182229; color: #00a884; padding: 2px 2px; font-size: 12px; line-height: 1.4; text-align: center; border-bottom: 1px solid #222d34; flex-shrink: 0; }
.info-banner.green { background: #005c4b; color: #e9edef; }
.info-banner.yellow { background: #423315; color: #fde047; }
.info-banner.red { background: #5c1a1a; color: #fecaca; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #00a884; color: #111b21; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.btn { background: #2a3942; color: #e9edef; border: none; padding: 7px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #37464f; }
.btn-g { background: #00a884; color: #111b21; font-weight: 600; }
.btn-r { background: #7f1d1d; color: #fecaca; }
.tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid #222d34; flex-shrink: 0; }
.tab { padding: 11px 4px; background: none; border: none; border-bottom: 2px solid transparent; color: #8696a0; cursor: pointer; font-size: 13px; }
.tab.active { color: #00a884; border-bottom-color: #00a884; font-weight: 600; }
#list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.item { padding: 6px 14px; border-bottom: 1px solid #222d34; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.item:hover, .item.active { background: #202c33; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #54656f; flex-shrink: 0; }
.dot.on { background: #00a884; }
main { flex: 1; display: flex; flex-direction: column; height: 100%; background: #0b141a; position: relative; }
#msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 10px; font-size: 14px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.me { background: #005c4b; align-self: flex-end; border-top-right-radius: 2px; }
.other { background: #202c33; align-self: flex-start; border-top-left-radius: 2px; }
.sender { font-size: 11px; font-weight: 600; color: #00a884; }
.time { font-size: 10px; color: #8696a0; text-align: right; margin-top: 3px; }
#form {
    min-height: 52px;
    background: #202c33;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}
textarea#inp {
    min-height: 46px;
    max-height: 150px;
    padding: 11px 14px;
    border-radius: 16px;
}
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}
input { width: 100%; background: #2a3942; border: 1px solid #37464f; color: #e9edef; border-radius: 20px; padding: 9px 14px; outline: none; font-size: 16px; }
#drawer { position: absolute; top: 54px; right: 0; width: 280px; height: calc(100% - 54px); background: #111b21; border-left: 1px solid #222d34; padding: 14px; overflow-y: auto; z-index: 20; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.card { background: #202c33; width: 100%; max-width: 400px; border-radius: 12px; padding: 20px; border: 1px solid #2a3942; }
.hidden { display: none !important; }
input, textarea { width: 100%; background: #2a3942; border: 1px solid #37464f; color: #e9edef; border-radius: 20px; padding: 9px 14px; outline: none; font-size: 16px; font-family: inherit;line-height: 1.35; resize: none; max-height: 110px; overflow-y: auto; }

#back-btn { display: none; margin-right: 6px; font-size: 15px; padding: 5px 10px; }

@media (max-width: 768px) {
    aside { width: 100%; min-width: 100%; border-right: none; }
    main { display: none; width: 100%; }
    body.in-chat aside { display: none; }
    body.in-chat main { display: flex; }
    #back-btn { display: inline-block; }
    #drawer { width: 100%; border-left: none; }
}
