:root{--orange:#e75526;--dark:#171717;--ink:#292929;--muted:#6d6d6d;--line:#e7e3df;--paper:#fff;--bg:#f6f4f2}
*{box-sizing:border-box}body{margin:0;background:linear-gradient(145deg,#f8f6f3,#eee9e4);font-family:"Segoe UI",Arial,sans-serif;color:var(--ink)}
.app-shell{width:min(960px,calc(100% - 32px));min-height:calc(100vh - 40px);margin:20px auto;background:var(--paper);border:1px solid #e3ddd7;border-radius:20px;box-shadow:0 22px 55px rgba(43,31,23,.12);display:flex;flex-direction:column;overflow:hidden}
.app-header{display:flex;align-items:center;gap:14px;padding:20px 24px;background:var(--dark);color:#fff;border-bottom:4px solid var(--orange)}
.header-avatar{width:240px;height:150px;border-radius:14px;object-fit:contain;object-position:center;border:3px solid var(--orange);background:#111;box-shadow:0 8px 20px rgba(0,0,0,.28)}.app-header h1{font-size:26px;margin:0}.app-header p{margin:4px 0 0;color:#c8c8c8;font-size:14px}
.status{margin-left:auto;font-size:12px;color:#d8d8d8}.status i{display:inline-block;width:8px;height:8px;background:#36c56c;border-radius:50%;margin-right:6px}
.conversation{flex:1;min-height:480px;max-height:calc(100vh - 240px);overflow-y:auto;padding:28px;background:radial-gradient(circle at top right,rgba(231,85,38,.05),transparent 34%)}
.message{display:flex;gap:10px;margin-bottom:20px;align-items:flex-start}.message.user{justify-content:flex-end}.message.user .avatar{order:2;background:#3b3b3b}.avatar{flex:0 0 38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--orange);color:#fff;font-size:12px;font-weight:700}.message.user .avatar{border-color:#3b3b3b}
.bubble{max-width:76%;padding:14px 16px;border-radius:6px 18px 18px 18px;background:#f2efec;border:1px solid #e5ded8;line-height:1.55}.user .bubble{background:var(--orange);color:#fff;border:0;border-radius:18px 6px 18px 18px}.bubble strong{display:block;font-size:12px;margin-bottom:5px}.bubble p{margin:0;white-space:pre-wrap}
.sources{margin-top:12px;padding-top:10px;border-top:1px solid rgba(100,90,80,.2)}.source{font-size:12px;margin-top:8px;color:#5d554e}.source b{color:var(--orange)}.mode{display:block;margin-top:10px;color:#8b8179;font-size:11px}
.composer{display:flex;gap:12px;padding:16px 20px;border-top:1px solid var(--line);background:#fff}.composer textarea{flex:1;resize:none;border:1px solid #cfc7bf;border-radius:12px;padding:12px 14px;font:inherit;outline:none}.composer textarea:focus{border-color:var(--orange);box-shadow:0 0 0 3px rgba(231,85,38,.12)}.composer button{border:0;border-radius:12px;padding:0 24px;background:var(--orange);color:#fff;font-weight:700;cursor:pointer}.composer button:disabled{opacity:.55;cursor:wait}
.notice{margin:0;padding:0 20px 15px;color:var(--muted);font-size:11px;text-align:center}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
@media(max-width:640px){.app-shell{width:100%;min-height:100vh;margin:0;border-radius:0}.app-header{padding:16px;align-items:flex-start;flex-wrap:wrap}.header-avatar{width:160px;height:100px}.status{display:none}.conversation{padding:18px;max-height:none}.bubble{max-width:86%}.composer{padding:12px}.composer button{padding:0 16px}}
