* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: radial-gradient(ellipse at top, #1e1238 0%, #0d0817 70%) fixed; color: #ece8f7; }
button { font: inherit; cursor: pointer; color: inherit; background: #231744; border: 1px solid #4a3585; border-radius: 10px; padding: 8px 12px; }
button:hover:not(:disabled) { background: #2f1f5a; }
button:focus-visible, textarea:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
button:disabled { opacity: .4; cursor: default; }
.app { display: flex; flex-direction: column; height: 100dvh; max-width: 860px; margin: 0 auto; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #222631; }
.logo { font-size: 1.3rem; letter-spacing: .04em; color: #c4b5fd; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { padding: 16px; border-bottom: 1px solid #2e2150; background: #150f26; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.panel h3 { margin: 6px 0 0; font-size: 1rem; }
.input { width: 100%; background: #12141a; color: inherit; border: 1px solid #2c313d; border-radius: 12px; padding: 10px 12px; font: inherit; resize: vertical; }
.btn { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.btn:hover:not(:disabled) { background: #6d28d9; }
.btn.ghost { background: transparent; color: #ddd6fe; border-color: #4a3585; }
a { color: #c4b5fd; }
.chat.auth-main .hello { margin: 0; }
.chat.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; max-height: none; border: 1px solid #2e2150; border-radius: 16px; padding: 24px; box-shadow: 0 10px 40px rgba(124, 58, 237, .18); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap .input { width: 100%; padding-right: 88px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #c4b5fd; cursor: pointer; padding: 6px 10px; font: inherit; font-size: .85rem; }
.note { margin: 0; color: #8bd4a0; font-size: .9rem; }
.conv { display: flex; gap: 6px; }
.conv-open { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hello { margin: auto; text-align: center; color: #a99fc4; }
.hello h1 { color: #ece8f7; margin-bottom: 4px; }
.msg { padding: 10px 14px; border-radius: 14px; max-width: 100%; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: #4a2b8c; max-width: 85%; }
.msg.assistant { background: #1a1230; border: 1px solid #2e2150; }
.txt { white-space: pre-wrap; margin: 4px 0; line-height: 1.5; }
.code { position: relative; background: #0a0614; border-radius: 10px; margin: 8px 0; }
.code pre { margin: 0; padding: 14px; overflow-x: auto; font-size: .85rem; }
.copy { position: absolute; top: 6px; right: 6px; padding: 2px 8px; font-size: .75rem; }
.typing { color: #8a90a0; font-size: .9rem; }
.composer { padding: 12px 16px 16px; border-top: 1px solid #222631; }
.box { display: flex; gap: 8px; align-items: flex-end; }
.send { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; background: #7c3aed; border-color: #7c3aed; color: #fff; }
.plus { padding: 8px 14px; font-size: 1.2rem; line-height: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: #231744; border: 1px solid #4a3585; border-radius: 999px; padding: 4px 10px; font-size: .85rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag button { padding: 0 4px; border: 0; background: none; }
.plusmenu { display: flex; flex-direction: column; gap: 6px; background: #150f26; border: 1px solid #2e2150; border-radius: 12px; padding: 8px; margin-bottom: 8px; max-width: 260px; }
.plusmenu button { text-align: left; }
.filecard { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #1a1230; border: 1px solid #4a3585; border-radius: 12px; padding: 10px 14px; }
.conv.active .conv-open { border-color: #a78bfa; }
.loading { display: flex; gap: 8px; align-items: center; color: #8a90a0; }
.spinner { width: 14px; height: 14px; border: 2px solid #444; border-top-color: #a78bfa; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: #8a90a0; padding: 8px 0; }
.empty-title { font-weight: 600; }
.alert { padding: 8px 12px; border-radius: 10px; margin-bottom: 8px; }
.alert-error { background: #3a1b20; color: #ffb3bd; }
