:root {
  --cs-accent: #2563eb;
  --cs-surface: #ffffff;
  --cs-border: #e5e7eb;
  --cs-cite-bg: #ffffff;
  --cs-cite-text: #111827;
  --cs-btn-font: 14px;
  --cs-btn-py: 10px;
  --cs-btn-px: 14px;
  --cs-btn-radius: 10px;
}

.cite-sidebar-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--cs-btn-py) var(--cs-btn-px);
  border: 0;
  border-radius: var(--cs-btn-radius);
  cursor: pointer;
  font: inherit;
  font-size: var(--cs-btn-font);
  line-height: 1;
}

#cite-sidebar-modal-root[aria-hidden="true"] {
  display: none;
}

.cite-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cite-sidebar-modal {
  width: min(720px, 100%);
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

.cite-sidebar-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cs-border);
}

.cite-sidebar-modal h2 {
  margin: 0;
  font-size: 16px;
}

.cite-sidebar-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cite-sidebar-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.cite-sidebar-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
}

.cite-sidebar-row label {
  font-weight: 600;
}

.cite-sidebar-row select,
.cite-sidebar-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--cs-border);
  border-radius: 10px;
  font: inherit;
}

/* Citation select (matches the "Style" dropdown look) */
.cite-sidebar-row select.cite-sidebar-citation-select {
  background: var(--cs-cite-bg);
  color: var(--cs-cite-text);
}

/* Citation selector should be readable by default (white bg, dark text),
   and configurable from admin settings. */
.cite-sidebar-citation-select {
  background: var(--cs-cite-bg);
  color: var(--cs-cite-text);
}

.cite-sidebar-results {
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0,0,0,0.02);
  min-height: 96px;
}

.cite-sidebar-results .cite-sidebar-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.cite-sidebar-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cite-sidebar-copy {
  background: var(--cs-accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}

.cite-sidebar-note {
  color: #6b7280;
  font-size: 12px;
}

@media (max-width: 520px) {
  .cite-sidebar-row {
    grid-template-columns: 1fr;
  }
}
