:root { --ink:#15213d; --muted:#69738a; --primary:#5b4cf0; --primary-dark:#4436d8; --cyan:#19b7c9; --surface:rgba(255,255,255,.92); --line:#e5e8f1; }
html,body { min-height:100%; }
body { min-height:100vh; min-height:100dvh; color:var(--ink); background:radial-gradient(circle at 8% 10%,rgba(91,76,240,.10),transparent 28rem),radial-gradient(circle at 92% 18%,rgba(25,183,201,.09),transparent 24rem),#f7f8fc!important; }
.app-navbar { color:#fff; background:linear-gradient(105deg,#182445,#382f8f 58%,#116e82); }
.app-navbar .navbar-brand,.app-navbar .navbar-text { color:#fff; }
.app-navbar .navbar-text { opacity:.7; font-size:.85rem; }
.brand-mark,.assistant-badge { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; color:#fff; background:linear-gradient(135deg,#776aff,#19b7c9); font-weight:800; }
.brand-mark { width:2rem; height:2rem; border-radius:.65rem; font-size:.72rem; box-shadow:0 7px 20px rgba(25,183,201,.28); }
.assistant-badge { width:1.7rem; height:1.7rem; border-radius:.55rem; font-size:.62rem; margin-right:.65rem; }
.eyebrow { color:var(--primary); font-size:.75rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.hero-copy { max-width:42rem; }
.hero-copy h1 { letter-spacing:-.035em; }
.upload-card,.chat-card { border-radius:1.25rem; background:var(--surface); backdrop-filter:blur(12px); }
.upload-zone { padding:2.8rem 1.5rem; border:2px dashed #cbd0e3; border-radius:1rem; background:linear-gradient(145deg,#fbfbff,#f4f7ff); cursor:pointer; transition:border-color .2s,transform .2s,background .2s; }
.upload-zone:hover,.upload-zone:focus-within,.upload-zone.has-file { border-color:var(--primary); background:#f4f2ff; transform:translateY(-2px); }
.upload-icon { display:inline-flex; align-items:center; justify-content:center; width:3.5rem; height:3.5rem; margin-bottom:1rem; border-radius:1rem; color:#fff; background:linear-gradient(135deg,var(--primary),var(--cyan)); font-size:1.8rem; box-shadow:0 12px 28px rgba(91,76,240,.25); }
.privacy-note { max-width:34rem; }
.btn-primary { border-color:var(--primary); background:linear-gradient(135deg,var(--primary),#6b5df5); box-shadow:0 8px 22px rgba(91,76,240,.2); }
.btn-primary:hover,.btn-primary:focus { border-color:var(--primary-dark); background:linear-gradient(135deg,var(--primary-dark),#5849e8); }
.processing-overlay { position:fixed; inset:0; z-index:1100; display:grid; place-items:center; padding:1.25rem; background:rgba(17,25,49,.64); backdrop-filter:blur(8px); }
.processing-card { width:min(100%,27rem); padding:2.25rem; border-radius:1.25rem; background:#fff; }
.processing-progress { height:.45rem; background:#eceefe; }
.processing-progress .progress-bar { width:100%; background-color:var(--primary); }
.document-loader { position:relative; width:4rem; height:5rem; border-radius:.6rem; background:linear-gradient(145deg,#6d60f5,#23b5c4); box-shadow:0 15px 35px rgba(91,76,240,.28); animation:documentPulse 1.5s ease-in-out infinite; }
.document-loader::after { content:""; position:absolute; top:0; right:0; border-style:solid; border-width:0 1.1rem 1.1rem 0; border-color:transparent rgba(255,255,255,.72) transparent transparent; }
.document-loader span,.document-loader span::before,.document-loader span::after { position:absolute; left:.75rem; right:.75rem; height:.2rem; border-radius:1rem; background:rgba(255,255,255,.85); content:""; }
.document-loader span { top:2rem; }.document-loader span::before { top:.65rem; left:0; right:0; }.document-loader span::after { top:1.3rem; left:0; right:.65rem; }
.is-processing { overflow:hidden; }
@keyframes documentPulse { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-8px) rotate(2deg)} }
.document-name { max-width:34rem; }
.chat-card { min-height:68vh; overflow:hidden; }
.messages { height:55vh; padding:1.5rem; overflow-y:auto; overscroll-behavior:contain; background:linear-gradient(180deg,#f9faff,#f5f7fb); scroll-behavior:smooth; }
.message { display:flex; align-items:flex-start; max-width:82%; padding:.85rem 1rem; margin-bottom:.9rem; border-radius:1rem; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; box-shadow:0 5px 16px rgba(24,36,69,.05); }
.message-content { min-width:0; }
.assistant-message { background:#fff; border:1px solid var(--line); border-bottom-left-radius:.3rem; }
.user-message { margin-left:auto; color:#fff; background:linear-gradient(135deg,var(--primary),#6859ea); border-bottom-right-radius:.3rem; box-shadow:0 8px 20px rgba(91,76,240,.17); }
.source-label { display:block; margin-top:.5rem; color:var(--muted); font-size:.8rem; }
.chat-footer { background:rgba(255,255,255,.94)!important; }
.chat-composer .form-control { min-width:0; border-color:#dce0eb; background:#f9faff; }
.chat-composer .form-control:focus { border-color:var(--primary); background:#fff; box-shadow:0 0 0 .22rem rgba(91,76,240,.12); }
.chat-composer .btn { min-width:6.5rem; }
.typing-message { width:fit-content; align-items:center; }
.typing-dots { display:inline-flex; gap:.28rem; padding:.45rem .15rem; }
.typing-dots i { width:.45rem; height:.45rem; border-radius:50%; background:#8b93a8; animation:typingBounce 1.1s infinite ease-in-out; }
.typing-dots i:nth-child(2){animation-delay:.15s}.typing-dots i:nth-child(3){animation-delay:.3s}
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0);opacity:.45} 30%{transform:translateY(-5px);opacity:1} }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; } }
@media (max-width:576px) {
  .app-main { padding-top:1rem!important; padding-bottom:max(1rem,env(safe-area-inset-bottom))!important; }
  .app-navbar { padding-top:max(.5rem,env(safe-area-inset-top)); }
  .navbar-brand { font-size:1rem; }
  .hero-copy h1 { font-size:2.15rem; }
  .hero-copy .lead { font-size:1rem; }
  .upload-card,.chat-card { border-radius:1rem; }
  .upload-zone { padding:2rem 1rem; }
  .upload-card .card-body { padding:1rem!important; }
  .upload-another { width:100%; min-height:44px; display:flex; align-items:center; justify-content:center; }
  .chat-card { display:flex; flex-direction:column; height:calc(100dvh - 13rem); min-height:31rem; }
  .messages { height:auto; min-height:0; flex:1 1 auto; padding:1rem; }
  .message { max-width:95%; padding:.72rem .82rem; margin-bottom:.75rem; font-size:.95rem; }
  .assistant-badge { margin-right:.5rem; }
  .chat-footer { flex:0 0 auto; padding:.75rem!important; padding-bottom:max(.75rem,env(safe-area-inset-bottom))!important; }
  .chat-composer { flex-direction:column; }
  .chat-composer .form-control { min-height:48px; font-size:1rem; border-radius:.65rem; }
  .chat-composer .btn { width:100%; min-height:46px; border-radius:.65rem; }
  .processing-card { padding:1.75rem 1.25rem; }
}
@media (max-height:650px) and (max-width:576px) { .chat-card { height:calc(100dvh - 10.5rem); min-height:24rem; } }
