.bibtex-section {
  display: block;
}

.bibtex-section .bibtex-shell {
  width: 100%;
  min-width: 0;
  max-width: 84rem;
  margin-right: auto;
  margin-left: auto;
}

.bibtex-card {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.bibtex-card .bibtex-scroll {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 4.25rem 1.5rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-accent);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: clamp(.8rem, 1.2vw, .9rem);
  scrollbar-width: thin;
}

.bibtex-card .bibtex-scroll code {
  display: block;
  width: max-content;
  min-width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.bibtex-card .copy-bibtex-btn {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 2;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .65rem .9rem;
  border: 2px solid white;
  border-radius: 10px;
  background: var(--primary-color);
  color: white;
  box-shadow: 0 7px 20px rgb(37 99 235 / .3);
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  font-weight: 800;
  transition: var(--transition);
}

.bibtex-card .copy-bibtex-btn:hover {
  background: var(--primary-hover);
  color: white;
  box-shadow: 0 10px 24px rgb(37 99 235 / .38);
  transform: translateY(-1px);
}

.bibtex-card .copy-bibtex-btn:focus-visible {
  outline: 3px solid rgb(37 99 235 / .3);
  outline-offset: 3px;
}

.bibtex-card .copy-bibtex-btn.copied {
  background: #047857;
}

@media screen and (max-width: 768px) {
  .bibtex-card .bibtex-scroll {
    padding: 4rem 1rem 1rem;
    font-size: .78rem;
  }
}
