/* Dark mode overrides for non-Bulma elements */
[data-theme="dark"] .chat-sidebar {
  background: #1a1a2e;
}
[data-theme="dark"] .chat-msg-assistant {
  background: #2d2d44;
  color: #e0e0e0;
}
[data-theme="dark"] .chat-msg-loading {
  background: #2d2d44;
  color: #888;
}
[data-theme="dark"] .chat-input-area {
  border-top-color: #444;
}

/* Chat sidebar */
.chat-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 360px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.chat-sidebar.is-hidden {
  display: none;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #3273dc;
  color: #fff;
}
.chat-header-title {
  font-weight: 600;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}
.chat-msg {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  max-width: 85%;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 0.9rem;
}
.chat-msg-user {
  background: #3273dc;
  color: #fff;
  margin-left: auto;
}
.chat-msg-assistant {
  background: #f5f5f5;
  color: #363636;
}
.chat-msg-loading {
  background: #f5f5f5;
  color: #999;
  font-style: italic;
}
.chat-input-area {
  padding: 0.75rem;
  border-top: 1px solid #eee;
}
.chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* When sidebar is open, shift main content */
body.chat-open .section {
  margin-right: 360px;
}

@media (max-width: 768px) {
  .chat-sidebar {
    width: 100%;
  }
}

