:root{color-scheme:light;--bg:#eef2f7;--panel:#ffffff;--panel-alt:#f7f9fc;--border:#d7dfeb;--text:#172033;--muted:#667085;--primary:#0084ff;--primary-dark:#0069d1;--incoming:#edf2f7;--shadow:0 24px 60px rgba(31,41,55,0.12)}*{box-sizing:border-box}body,html{margin:0;height:100%;font-family:Segoe UI,sans-serif;background:radial-gradient(circle at top left,rgba(0,132,255,.15),transparent 30%),linear-gradient(180deg,#f8fbff 0,var(--bg) 100%);color:var(--text);overflow:hidden}body{min-height:100vh}button,input{font:inherit}button{cursor:pointer}.loading-screen,.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px}.login-card{width:min(100%,420px);background:rgba(255,255,255,.92);border:1px solid rgba(255,255,255,.8);border-radius:28px;box-shadow:var(--shadow);padding:32px;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}.login-card h1{margin:14px 0 8px;font-size:28px}.login-card p,.login-hint{margin:0;color:var(--muted)}.login-badge{display:inline-flex;padding:8px 12px;border-radius:999px;background:rgba(0,132,255,.1);color:var(--primary-dark);font-weight:600}.login-form{display:grid;grid-gap:12px;gap:12px;margin-top:24px}.composer input,.login-form input{width:100%;border:1px solid var(--border);border-radius:16px;min-height:48px;padding:14px 16px;outline:none;background:#fff}.composer input:focus,.login-form input:focus{border-color:var(--primary)}.composer button,.ghost-button,.login-form button,.primary-button{border:0;border-radius:16px;padding:12px 16px;transition:.2s ease}.composer button,.login-form button,.primary-button{background:var(--primary);color:#fff;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:8px}.composer button:hover,.login-form button:hover,.primary-button:hover{background:var(--primary-dark)}.ghost-button{background:#eef4ff;color:var(--primary-dark);display:inline-flex;align-items:center;justify-content:center}.icon-button{width:44px;height:44px;padding:0;border-radius:14px;flex:none}.form-error,.page-error{color:#c62828;font-size:14px}.messenger-shell{height:100vh;display:grid;grid-template-columns:360px 1fr;padding:20px;grid-gap:20px;gap:20px;overflow:hidden}.chat-panel,.sidebar{background:rgba(255,255,255,.9);border:1px solid rgba(255,255,255,.85);border-radius:28px;box-shadow:var(--shadow);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.sidebar{display:flex;flex-direction:column;overflow:hidden;min-height:0}.chat-header,.composer,.sidebar-header{padding:20px;border-bottom:1px solid var(--border)}.brand-block,.chat-user,.composer,.sidebar-actions,.sidebar-header{display:flex;align-items:center}.brand-block{gap:12px}.brand-logo{width:42px;height:42px;border-radius:12px;object-fit:cover;background:#e7eef8;border:1px solid var(--border)}.chat-user,.sidebar-header{justify-content:space-between}.chat-header h3,.sidebar-header h2{margin:4px 0 0}.brand-block>div{display:grid;grid-gap:2px;gap:2px}.brand-block .status-label{line-height:1.1}.brand-block h2,.brand-block h3{margin:0;line-height:1.15}.status-label{color:#0f9d58;font-size:13px;font-weight:600}.sidebar-actions{padding:16px 20px}.conversation-list,.messages-area{overflow:auto;min-height:0}.conversation-list{padding:8px 12px 12px}.conversation-item{width:100%;display:flex;align-items:center;gap:12px;border:0;background:transparent;padding:12px;border-radius:20px;text-align:left;margin-bottom:6px}.conversation-item.active,.conversation-item:hover{background:#edf4ff}.conversation-meta{display:grid;grid-gap:4px;gap:4px}.conversation-meta span{font-size:13px;color:var(--muted)}.avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#0ea5e9,#2563eb);color:#fff;font-weight:700;flex:none}.avatar.large{width:52px;height:52px}.chat-panel{display:grid;grid-template-rows:auto 1fr auto auto;min-height:calc(100vh - 40px);overflow:hidden;min-width:0}.chat-user{justify-content:flex-start;gap:14px}.chat-user-meta{display:grid;grid-gap:3px;gap:3px}.chat-user-meta h3{margin:0;line-height:1.15}.chat-user span{color:var(--muted);font-size:14px;line-height:1.2}.messages-area{padding:24px;background:linear-gradient(180deg,rgba(247,249,252,.35),rgba(247,249,252,.75)),var(--panel-alt);min-height:0}.message-row{display:flex;margin-bottom:12px}.message-row.incoming{justify-content:flex-start}.message-row.outgoing{justify-content:flex-end}.message-bubble{max-width:min(70%,560px);padding:12px 14px;border-radius:22px;background:var(--incoming)}.message-row.outgoing .message-bubble{background:linear-gradient(180deg,#1b91ff,#0078ff);color:#fff}.message-bubble p{margin:0 0 6px;white-space:pre-wrap}.message-bubble span{display:block;font-size:12px;opacity:.75}.composer{gap:12px;border-top:1px solid var(--border);border-bottom:0}.composer button{min-height:48px;padding:0 18px;align-self:stretch;flex:none}.composer .send-button{background:#0f9d58}.composer .send-button:hover{background:#0c7f47}.composer button:disabled,.composer input:disabled{opacity:.6;cursor:not-allowed}.empty-state,.page-error{display:grid;place-items:center;min-height:120px;color:var(--muted);text-align:center}.more-badge{margin:10px 12px 4px;padding:12px 14px;border-radius:18px;background:#f1f5fb;color:var(--muted);font-size:14px;font-weight:600;text-align:center}.page-error{padding:0 20px 20px;min-height:auto}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media (max-width:920px){.messenger-shell{grid-template-columns:1fr;grid-template-rows:minmax(260px,40vh) minmax(0,1fr)}.sidebar{height:100%}.chat-panel{min-height:0}}