html, body { height: 100%; }
body { background: #ecebf3; }
.app { max-width: 760px; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); box-shadow: 0 0 40px rgba(46, 16, 101, .08); }
.bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, #6d28d9, #3b0f86); color: #fff; }
.bar .mark { background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .25); }
.bar .small { color: #ddd3ff; }
.bar .back { color: #fff; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; }
.bar .back:hover { background: rgba(255, 255, 255, .12); }
.bar .back svg { width: 20px; height: 20px; }
.bar button.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.bar button.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.log { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.notice { align-self: center; max-width: 90%; text-align: center; font-size: 12px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--brand-600); color: #fff; border-top-right-radius: 4px; }
.msg .who { font-size: 11px; font-weight: 700; color: var(--brand-600); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }
.msg .time { display: block; text-align: right; font-size: 10px; opacity: .6; margin-top: 4px; }
.cards { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; white-space: normal; }
.pcard { flex: 0 0 170px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.pcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; }
.pcard .ci { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.pcard .cn { font-weight: 600; font-size: 13px; }
.pcard .cp { color: var(--brand-700); font-weight: 700; }
.pcard button { margin-top: 4px; }
.typing { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-400); animation: b 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes b { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.cartbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--brand-50); border-top: 1px solid var(--line); font-size: 13px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px 0; scrollbar-width: none; }
.chips button { background: var(--surface); color: var(--text-2); border-color: var(--line-2); border-radius: 999px; padding: 5px 12px; font-weight: 500; font-size: 13px; }
.chips button:hover { color: var(--brand-700); border-color: var(--brand-400); background: var(--brand-50); }
.composer { display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.composer input { border-radius: 999px; padding: 11px 16px; }
.composer button { border-radius: 50%; width: 44px; height: 44px; padding: 0; flex: none; }
.composer button svg { width: 18px; height: 18px; }
.zoom { position: fixed; inset: 0; background: rgba(0, 0, 0, .8); display: grid; place-items: center; z-index: 50; padding: 16px; }
.zoom img { max-width: 100%; max-height: 90vh; border-radius: 12px; }
.composer .mic { background: var(--surface); color: var(--brand-600); border-color: var(--line-2); }
.composer .mic:hover { background: var(--brand-50); color: var(--brand-700); }
.composer .mic.rec { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .45); } 50% { box-shadow: 0 0 0 8px rgba(185, 28, 28, 0); } }
.msg .vtag { display: block; font-size: 11px; opacity: .75; margin-bottom: 2px; }
