/* Replace ArrowLeft icon with X (close) in element side panel */
#side-view-title button svg {
  display: none;
}

#side-view-title button::after {
  content: "✕";
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
}

/* Clickable source links in synthesis messages */
.source-clickable {
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
.source-clickable:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ---- Source document side panel (matches Chainlit's native sidebar) ---- */
#source-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  background: var(--paper-surface, #1e1e1e);
  color: var(--body-color, #e0e0e0);
  border-left: 1px solid var(--border-color, #333);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
#source-panel.open {
  transform: translateX(0);
}
#source-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #333);
  flex-shrink: 0;
  min-height: 48px;
}
#source-panel-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
#source-panel-close {
  background: none;
  border: none;
  color: var(--body-color, #aaa);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
#source-panel-close:hover {
  background: rgba(255, 255, 255, 0.1);
}
#source-panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  line-height: 1.75;
}
#source-panel-body p {
  margin: 0 0 12px;
}

/* Highlighted cited passage */
.highlight-passage {
  background: rgba(250, 204, 21, 0.2);
  border-left: 3px solid #facc15;
  padding: 8px 12px;
  display: block;
  margin: 8px 0;
  border-radius: 0 4px 4px 0;
}

/* Loading / error states */
.source-loading {
  padding: 40px 16px;
  text-align: center;
  color: var(--body-color, #999);
  font-style: italic;
}
.source-error {
  padding: 16px;
  color: #f87171;
}

/* Token wheel widget — visual polish */
#token-wheel-container {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
#token-wheel-container:hover {
  opacity: 1;
}

