*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;background:linear-gradient(135deg,#f6f9fc 0%,#edf2f9 100%);min-height:100vh;color:#1a2b3c}.app-header{background:#fff;border-bottom:1px solid rgba(0,0,0,.05);padding:.75rem 1rem;position:sticky;top:0;z-index:10;backdrop-filter:blur(10px);background:rgba(255,255,255,.95)}.header-content{max-width:1600px;margin:0 auto;display:flex;flex-direction:column;gap:.75rem}.logo{display:flex;align-items:center;justify-content:center;gap:.5rem;font-weight:600;font-size:1rem;color:#1a2b3c}.logo svg{width:24px;height:24px;color:#3b82f6}.api-config{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.api-input{flex:1;min-width:120px;padding:.5rem .75rem;border:1px solid #e2e8f0;border-radius:12px;font-size:.875rem;transition:all .2s;background:#fff}.api-input:focus{outline:0;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.chat-container{max-width:1600px;margin:1rem auto;padding:0 1rem;display:flex;flex-direction:column;gap:1rem;min-height:calc(100vh - 130px)}.chat-panel,.pdf-panel{background:#fff;border-radius:20px;box-shadow:0 20px 40px rgba(0,0,0,.03),0 8px 20px rgba(0,0,0,.06);display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(226,232,240,.6);height:auto;min-height:400px}.chat-header,.pdf-header{padding:1rem;border-bottom:1px solid #e2e8f0;background:#fafcff}.chat-header h2,.pdf-header h2{font-size:1.1rem;font-weight:600;color:#1a2b3c;display:flex;align-items:center;gap:.5rem}.chat-header p{color:#64748b;font-size:.75rem}.messages-container{flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.75rem;background:#fff;min-height:300px;max-height:50vh}.message{display:flex;flex-direction:column;max-width:90%;animation:fadeIn .3s ease}.message.user{align-self:flex-end}.message.assistant{align-self:flex-start}.message-content{padding:.75rem 1rem;border-radius:18px;font-size:.875rem;line-height:1.5;box-shadow:0 2px 8px rgba(0,0,0,.02)}.user .message-content{background:linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);color:#fff;border-bottom-right-radius:4px}.assistant .message-content{background:#f1f5f9;color:#1e293b;border-bottom-left-radius:4px}.message-meta{display:flex;align-items:center;gap:.5rem;margin-top:.25rem;font-size:.7rem;color:#64748b;padding:0 .5rem}.status-indicator{display:inline-flex;align-items:center;gap:.375rem}.status-dot{width:8px;height:8px;border-radius:50%;background:#10b981;animation:pulse 1.5s infinite}.status-dot.thinking{background:#f59e0b}.status-dot.done{background:#10b981;animation:none}.status-dot.error{background:#ef4444;animation:none}.chat-input-area{padding:1rem;border-top:1px solid #e2e8f0;background:#fafcff}.input-wrapper{display:flex;gap:.5rem;background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:.25rem;transition:all .2s}.input-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.chat-input{flex:1;border:0;padding:.75rem .75rem;font-size:.9375rem;background:transparent;min-height:44px}.chat-input:focus{outline:0}.send-button,.file-attach-btn,.pdf-action-btn{min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s}.send-button{background:#3b82f6;color:#fff;border:0;border-radius:12px;padding:0 1rem;font-weight:600;font-size:.875rem;gap:.5rem}@media(max-width:480px){.send-button span{display:none}.send-button{padding:0 .75rem}}.send-button:hover:not(:disabled){background:#2563eb;transform:translateY(-1px)}.send-button:disabled{background:#94a3b8;cursor:not-allowed;opacity:.6}.file-attach-btn{background:transparent;border:0;color:#64748b;border-radius:12px;padding:.5rem}.file-attach-btn:hover{background:#f1f5f9;color:#1e293b}.pdf-viewer{flex:1;padding:1rem;overflow-y:auto;background:#f8fafc;max-height:50vh}.pdf-content{background:#fff;border-radius:12px;padding:1rem;box-shadow:0 4px 12px rgba(0,0,0,.02);border:1px solid #e2e8f0;font-family:'Georgia',serif;line-height:1.6;color:#2c3e50;word-wrap:break-word;overflow-wrap:break-word}.pdf-content h1{font-size:1.5rem;margin-bottom:1rem}.pdf-content h2{font-size:1.25rem;margin:1.5rem 0 .75rem}.pdf-content p{margin-bottom:.75rem}.pdf-actions{display:flex;gap:.5rem}.pdf-action-btn{background:transparent;border:0;border-radius:8px;color:#64748b;padding:.5rem}.pdf-action-btn:hover{background:#f1f5f9;color:#1e293b}.file-info{font-size:.75rem;color:#64748b;margin-top:.5rem;display:flex;align-items:center;gap:.5rem;padding:.5rem;background:#f1f5f9;border-radius:8px;flex-wrap:wrap}.remove-file{background:none;border:0;color:#ef4444;cursor:pointer;font-size:1.25rem;padding:.25rem .5rem;min-height:32px;min-width:32px}#chatError{background:#fee2e2;border:1px solid #ef4444;color:#b91c1c;padding:.75rem;border-radius:8px;margin-top:.5rem;display:none;font-size:.875rem}.pdf-placeholder{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#94a3b8;text-align:center;padding:2rem}.pdf-placeholder svg{width:48px;height:48px;margin-bottom:1rem}@media(min-width:768px){.app-header{padding:1rem 2rem}.header-content{flex-direction:row;justify-content:space-between;gap:2rem}.logo{justify-content:flex-start;font-size:1.25rem}.api-config{flex:1;justify-content:flex-end}.chat-container{margin:2rem auto;padding:0 2rem;display:grid;grid-template-columns:1fr 1fr;gap:2rem;height:calc(100vh - 140px);min-height:auto}.chat-panel,.pdf-panel{height:100%;min-height:auto}.messages-container{max-height:none;min-height:400px}.pdf-viewer{max-height:none}.chat-header,.pdf-header{padding:1.5rem}.chat-header h2,.pdf-header h2{font-size:1.25rem}.messages-container{padding:1.5rem;gap:1rem}.message{max-width:85%}.message-content{padding:1rem 1.25rem;font-size:.9375rem}.pdf-content{padding:2rem}.pdf-content h1{font-size:2rem}.pdf-content h2{font-size:1.5rem}.send-button span{display:inline}}@media(min-width:1024px){.message{max-width:75%}.chat-container{gap:2rem}}@keyframes fadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}input,select,textarea{font-size:16px}html{scroll-behavior:smooth}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{animation-duration:.01ms!important;transition-duration:.01ms!important}}