:root {
  --bg: #f5f6f8;
  --sidebar: #1f2937;
  --accent: #4f46e5;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { background: var(--bg); font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }

/* логин */
.login-wrap { height: 100%; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card .sub { color: #888; font-size: 13px; margin-bottom: 20px; }

/* раскладка */
.layout { display: flex; height: 100%; }
.sidebar { width: 300px; background: var(--sidebar); color: #fff; display: flex; flex-direction: column; }
.sidebar .head { padding: 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .head .user { font-weight: 600; }
.sidebar .head .role { color: #9ca3af; font-size: 12px; }
.sidebar .sess-list { flex: 1; overflow-y: auto; padding: 8px; }
.sess-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; }
.sess-item:hover { background: rgba(255,255,255,.08); }
.sess-item.active { background: rgba(255,255,255,.14); }
.sess-item .nm { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-item .own { font-size: 11px; color: #9ca3af; }
.sidebar .foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.1); }

/* чат */
.chat { flex: 1; display: flex; flex-direction: column; background: #fff; }
.chat-head { padding: 12px 18px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 10px; }
.chat-head .title { font-weight: 600; flex: 1; }
.messages { flex: 1; overflow-y: auto; padding: 20px; }
.msg { margin-bottom: 14px; display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 72%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.msg.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.msg.assistant .bubble { background: #f1f3f5; color: #111; border-bottom-left-radius: 3px; }
.msg.status { justify-content: center; }
.msg.status .bubble { background: #eef2ff; color: #4338ca; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; max-width: 80%; }
.msg.service { justify-content: flex-start; }
.msg.service .bubble { background: #fff7ed; color: #92400e; font-size: 12px; font-family: ui-monospace, monospace; border-left: 3px solid #f59e0b; }

.files-strip { padding: 10px 18px; border-top: 1px solid #e5e7eb; display: flex; flex-wrap: wrap; gap: 8px; background: #fafafa; }
.file-chip { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 5px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.file-chip a { text-decoration: none; color: #1d4ed8; }
.file-chip .del { color: #999; cursor: pointer; }

.composer { padding: 12px 18px; border-top: 1px solid #e5e7eb; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; max-height: 140px; min-height: 44px; outline: none; }
.composer textarea:focus { border-color: var(--accent); }

.empty { flex: 1; display: flex; align-items: center; justify-content: center; color: #9ca3af; flex-direction: column; gap: 8px; }

.typing { color: #6b7280; font-size: 13px; padding: 4px 6px; }
.btn-accent { background: var(--accent); color: #fff; border: none; }
.btn-accent:hover { background: #4338ca; color: #fff; }
