.dash { flex: 1; display: flex; overflow: hidden; position: relative; }
.sidebar { width: 260px; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: transform .25s; }
.sidebar-head { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sidebar-head .logo { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
.chat-list { flex: 1; overflow-y: auto; padding: 8px; }
.chat-item { padding: 12px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--muted); transition: background .1s; border-left: 3px solid transparent; }
.chat-item:hover { background: var(--card); }
.chat-item.active { background: var(--card); color: var(--text); border-left-color: var(--red); }
.chat-item span.title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chat-item .del { padding: 4px 8px; opacity: .5; display: flex; align-items: center; }
.chat-item .del:hover { opacity: 1; color: var(--red-bright); }
.chat-item .del svg { width: 14px; height: 14px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sidebar-foot button { width: 100%; text-align: left; padding: 8px; color: var(--muted); font-size: 13px; border-radius: 6px; }
.sidebar-foot button:hover { color: var(--red-bright); background: rgba(220, 38, 38, 0.08); }
.sidebar-foot .subscribe-btn { color: var(--red-bright); font-weight: 700; background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); margin-bottom: 8px; text-align: center; }
.sidebar-foot .subscribe-btn:hover { background: rgba(220, 38, 38, 0.2); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; font-size: 22px; padding: 4px 8px; }
.topbar h2 { font-size: 15px; font-weight: 600; flex: 1; }
.topbar .email { font-size: 11px; color: var(--red-bright); font-weight: 700; letter-spacing: 0.5px; font-family: var(--mono); padding: 4px 10px; border-radius: 6px; background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); }
.topbar .email.upgrade { cursor: pointer; color: var(--yellow); background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.3); }
.topbar .email.upgrade:hover { background: rgba(234, 179, 8, 0.2); }

.messages { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 780px; width: 100%; padding: 14px 16px; border-radius: 12px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; align-self: flex-end; margin-left: auto; max-width: 85%; box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25); }
.msg.assistant { background: var(--card); border: 1px solid var(--border); align-self: flex-start; border-left: 3px solid var(--red); }
.msg pre { background: #0a0303; border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 13px; margin: 10px 0; position: relative; white-space: pre; }
.msg code { font-family: var(--mono); font-size: 13px; background: #0a0303; padding: 2px 5px; border-radius: 4px; color: #ff8888; }
.msg pre code { background: none; padding: 0; }
.copy-btn { position: absolute; top: 6px; right: 6px; background: var(--bg2); border: 1px solid var(--border); color: var(--muted); font-size: 11px; padding: 3px 8px; border-radius: 4px; font-family: var(--mono); }
.copy-btn:active { background: var(--red); color: #fff; }

.empty { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-inner h3 { font-size: 22px; color: var(--text); margin-bottom: 8px; }
.empty-inner p { font-size: 14px; }

.composer { padding: 12px 16px 20px; border-top: 1px solid var(--border); }
.composer-inner { max-width: 780px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { resize: none; max-height: 160px; min-height: 46px; padding: 12px 14px; line-height: 1.4; }
.composer button.send { width: 46px; height: 46px; padding: 0; border-radius: 10px; background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; flex-shrink: 0; box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35); display: flex; align-items: center; justify-content: center; }
.composer button.send:disabled { opacity: .4; box-shadow: none; }

.typing { display: inline-block; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.typing::after { content: "▋"; animation: blink 1s infinite; color: var(--red-bright); }

.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 5; }
.backdrop.show { display: block; }

@media (max-width: 720px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 10; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
}