.popup {
  box-sizing: border-box;
  width: min(48rem, calc(100vw - 2rem)) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid var(--line);
  border-radius: .8rem;
  box-shadow: 0 1.25rem 3rem rgba(7, 27, 33, .32);
}

.bibtex-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem .85rem 1.2rem;
  background: var(--brand);
  color: white;
}

.bibtex-popup-actions { display: flex; gap: .5rem; align-items: center; }

.bibtex-copy, .popup .bClose {
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: .4rem;
  background: transparent;
  box-shadow: none;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1;
  padding: .45rem .65rem;
}

.popup .bClose { position: static; font-size: 1.1rem; padding: .32rem .55rem; }
.bibtex-copy:hover, .bibtex-copy:focus-visible, .popup .bClose:hover, .popup .bClose:focus-visible { background: rgba(255, 255, 255, .18); outline: 2px solid white; outline-offset: 1px; }
.bibtex-copy.is-copied { background: #d5f0dc; border-color: #d5f0dc; color: #174a2a; }

.bibtex-code {
  box-sizing: border-box;
  max-height: min(62vh, 32rem);
  margin: 0;
  overflow: auto;
  padding: 1.2rem;
  background: #f6f9f8;
  color: #18343b;
  font: .84rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

@media (max-width: 480px) {
  .popup { width: calc(100vw - 1rem) !important; }
  .bibtex-popup-header { padding: .75rem .8rem; }
  .bibtex-code { max-height: 68vh; padding: .9rem; font-size: .76rem; }
}
