.shar-wrap {
  position: fixed; 
  bottom: 1.2rem; 
  right: 1.2rem; 
  z-index: 9999; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.shar-btn { 
  background: var(--brand); 
  color: #fff; 
  border: none; 
  border-radius: 50%;
  width: 56px; 
  height: 56px; 
  font-size: 1.6rem; 
  cursor: pointer; 
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

.shar-box { 
  position: absolute; 
  bottom: 72px; 
  right: 0; 
  width: 340px; 
  height: 480px;
  display: flex; 
  flex-direction: column; 
  border-radius: 16px; 
  background: var(--surface, #ffffff);
  box-shadow: 0 12px 40px rgba(0,0,0,.15); 
  overflow: hidden;
  border: 1px solid var(--border, #e1e5e9);
}

.shar-box.hidden { 
  display: none; 
}

.shar-messages { 
  flex: 1; 
  padding: 1.5rem 1rem; 
  overflow-y: auto; 
  font-size: 0.95rem;
  background: var(--surface, #ffffff);
}

.shar-messages::-webkit-scrollbar {
  width: 4px;
}

.shar-messages::-webkit-scrollbar-track {
  background: transparent;
}

.shar-messages::-webkit-scrollbar-thumb {
  background: var(--border, #e1e5e9);
  border-radius: 2px;
}

.shar-msg { 
  margin: 0 0 1rem; 
  line-height: 1.4; 
  word-wrap: break-word;
  display: flex;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shar-msg.user { 
  justify-content: flex-end;
}

.shar-msg.user .bubble {
  background: var(--brand, #007bff);
  color: white;
  border-bottom-right-radius: 4px;
}

.shar-msg.assistant { 
  justify-content: flex-start;
}

.shar-msg.assistant .bubble {
  background: var(--surface-alt, #f8f9fa);
  color: var(--text, #333);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border, #e1e5e9);
}

.shar-msg.error .bubble {
  background: #fee;
  color: #d63384;
  border: 1px solid #f5c6cb;
  font-style: italic;
}

.bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}

.shar-form { 
  display: flex;
  border-top: 1px solid var(--border, #e1e5e9);
  background: var(--surface, #ffffff);
}

.shar-form input { 
  flex: 1; 
  border: none;
  padding: 1rem 1.25rem; 
  font-size: 0.95rem; 
  outline: none;
  background: transparent;
  color: var(--text, #333);
}

.shar-form input::placeholder {
  color: var(--text-muted, #6c757d);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .shar-wrap {
    bottom: 1rem;
    right: 1rem;
  }
  
  .shar-box {
    width: calc(100vw - 2rem);
    right: -1rem;
    height: 60vh;
    max-height: 500px;
  }
  
  .bubble {
    max-width: 85%;
  }
}

.shar-send-btn {
  background: #764ba2;
  border: none;
  border-radius: 0;
  width: 40px;
  height: 40px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
  outline: none;
}

.shar-send-btn:hover {
  background: #6c4396;
  transform: scale(1.05);
}

.shar-send-btn:active {
  transform: scale(0.95);
}

.shar-send-btn:focus {
  outline: none;
}

.shar-form { 
  display: flex;
  border-top: 1px solid #e1e5e9;
  background: white;
  align-items: stretch;
  padding: 0;
}

.shar-form input { 
  flex: 1; 
  border: none;
  padding: 0.75rem 1rem; 
  font-size: 0.95rem; 
  outline: none;
  background: transparent;
  color: #333;
}

.shar-send-btn {
  background: #8338ec;
  border: none;
  border-radius: 0;
  width: auto;
  height: 100%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin: 0;
  outline: none;
  padding: 0.75rem 1rem;
  min-width: 50px;
}