* {
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:"Segoe UI", Arial, sans-serif;
}

body {
    background:#10131A;
    color:white;
}

.app {
    max-width:900px;
    margin:auto;
    height:100vh;
    display:flex;
    flex-direction:column;
    position:relative;
}

/* HEADER */
header {
    background:#10131A;
    padding:15px;
    border-bottom:1px solid #303340;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

header .left {
    display:flex;
    align-items:center;
    gap:10px;
}

.icon-btn {
    background:#303340;
    border:none;
    color:white;
    padding:8px 10px;
    border-radius:12px;
    cursor:pointer;
    transition:0.2s;
}

.icon-btn:hover { opacity:0.85; }

.status { color:#7e8cff; font-size:14px; }

/* CHAT */
main {
    flex:1;
    overflow-y:auto;
    padding:15px;
    display:flex;
    flex-direction:column;
    gap:12px;
    scroll-behavior:smooth;
}

main::-webkit-scrollbar {
    width:6px;
}

main::-webkit-scrollbar-thumb {
    background:#3b3f54;
    border-radius:20px;
}

.message {
    max-width:85%;
    padding:12px 16px;
    line-height:1.5rem;
    border-radius:14px;
    word-wrap:break-word;
    animation:pop .15s ease;
}

@keyframes pop {
    from { transform:scale(.95); opacity:0; }
    to { transform:scale(1); opacity:1; }
}

.user {
    background:#3b3f52;
    align-self:flex-end;
    border-radius:16px 16px 4px 16px;
}

.ai {
    background:#1b1f2a;
    border:1px solid #303340;
    align-self:flex-start;
    border-radius:16px 16px 16px 4px;
}

/* INPUT BAR */
.input-box {
    padding:14px;
    background:#10131A;
    border-top:1px solid #303340;
    display:flex;
    gap:10px;
    align-items:center;
}

.chat-input-wrapper {
    background:#303340;
    padding:6px 12px;
    border-radius:999px;
    width:100%;
    display:flex;
    align-items:center;
}

.input-box input {
    flex:1;
    padding:10px 16px;
    border-radius:999px;
    border:none;
    background:transparent;
    color:white;
    outline:none;
    font-size:14px;
}

.input-box button {
    padding:10px 20px;
    border-radius:999px;
    border:none;
    background:#7e8cff;
    color:#10131A;
    font-weight:bold;
    cursor:pointer;
    transition:0.2s;
}

.input-box button:hover { opacity:.9; }
.input-box button:active { transform:scale(.97); }

/* DRAWER */
.drawer {
    position:absolute;
    left:-100%;
    top:0;
    height:100%;
    width:260px auto;
    background:#1b1f2a;
    border-right:1px solid #303340;
    transition:.3s;
    z-index:10;
    display:flex;
    flex-direction:column;
}

.drawer.show { left:0; }

.drawer-header {
    padding:15px;
    border-bottom:1px solid #303340;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.drawer-header button {
    background:#c0392b;
    color:white;
    border:none;
    padding:7px 10px;
    border-radius:8px;
    cursor:pointer;
    font-size:12px;
}

.history-list {
    flex:1;
    overflow-y:auto;
    padding:10px;
}

.history-item {
    padding:10px;
    background:#303340;
    border-radius:10px;
    margin-bottom:8px;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:8px;
}

.history-item:hover {
    background:#4a4f6a;
}

/* Overlay */
.overlay {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    display:none;
    z-index:5;
}

.overlay.show { display:block; }

/* Keyla Ai Title */
.keyla-title { 
    font-family:sans-serif; 
    font-weight:600; 
    font-size: 19px;
    color:#7e8cff;
}

/* RESPONSIVE */
@media(max-width:600px){
    .message { max-width:95%; }
    .drawer { width:80%; }
}