.rf-biblio-report {
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

.rf-biblio-report h1.rf-section-title {
  font-family: "Fraunces", "Georgia", serif;
}

.rf-biblio-report .rf-stat .value {
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

.rf-biblio-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 992px) {
  .rf-biblio-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }
}

.rf-biblio-sidebar {
  position: sticky;
  top: 1rem;
}

.rf-biblio-mobile-nav {
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.rf-biblio-main {
  min-width: 0;
}

@media (max-width: 991.98px) {
  .rf-biblio-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 0.25rem;
  }

  .rf-biblio-tabs .nav-item {
    flex: 0 0 auto;
  }

  .rf-biblio-tabs .nav-link {
    white-space: nowrap;
  }

  .rf-biblio-summary-grid {
    grid-template-columns: 1fr;
  }

  .rf-chart-panel-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  .rf-biblio-table-toolbar,
  .rf-biblio-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .rf-biblio-search {
    max-width: none;
    width: 100%;
  }
}

.rf-biblio-nav .nav-link {
  width: 100%;
  text-align: left;
  color: var(--rf-primary);
  border-radius: 0.45rem;
  font-family: "DM Sans", sans-serif;
}

.rf-biblio-nav .nav-link.active,
.rf-biblio-nav .nav-link:hover {
  background: rgba(var(--rf-accent-rgb), 0.1);
  color: var(--rf-primary);
}

.rf-biblio-tabs {
  border-bottom: 1px solid rgba(var(--rf-primary-rgb), 0.1);
  margin-bottom: 1rem;
}

.rf-biblio-tabs .nav-link {
  color: var(--rf-primary);
  font-family: "DM Sans", sans-serif;
}

.rf-biblio-tabs .nav-link.active {
  color: var(--rf-accent);
  border-color: rgba(var(--rf-primary-rgb), 0.1) rgba(var(--rf-primary-rgb), 0.1) #fff;
}

.rf-biblio-summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.rf-biblio-summary-item {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(var(--rf-primary-rgb), 0.08);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.72);
}

.rf-biblio-summary-item .label {
  display: block;
  font-family: "DM Sans", sans-serif;
  font-size: 0.82rem;
  color: var(--rf-text-secondary);
  margin-bottom: 0.25rem;
}

.rf-biblio-summary-link {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rf-biblio-summary-link:hover,
.rf-biblio-summary-link:focus-visible {
  background: rgba(var(--rf-accent-rgb), 0.08);
  border-color: rgba(var(--rf-accent-rgb), 0.28);
  outline: none;
}

.rf-chart-order-note {
  margin-bottom: 0.75rem;
}

.rf-biblio-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.rf-biblio-table {
  width: max-content;
  min-width: 100%;
}

.rf-biblio-table td,
.rf-biblio-table th {
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
}

.rf-biblio-table-toolbar,
.rf-biblio-table-toolbar.rf-biblio-table-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.rf-biblio-search {
  max-width: 280px;
}

.rf-biblio-table th,
.rf-biblio-table td {
  font-family: "DM Sans", sans-serif;
  font-size: 0.88rem;
  vertical-align: top;
}

.rf-biblio-sort {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}

.rf-biblio-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.rf-chart-wrap {
  position: relative;
  min-height: 280px;
}

.rf-chart-wrap-tall {
  min-height: 420px;
}

.rf-chart-wrap-treemap {
  min-height: 640px;
}

.rf-chart-wrap-map {
  min-height: 460px;
  height: 460px;
}

.rf-map-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 0.25rem;
}

.rf-map-legend {
  flex: 0 0 auto;
  max-width: 32rem;
  margin: 0 auto;
  width: 100%;
  padding: 0 0.5rem;
}

.rf-map-legend-bar {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 0.85rem;
  border-radius: 0.35rem;
  overflow: hidden;
  border: 1px solid rgba(var(--rf-primary-rgb), 0.12);
  background: #e8e8e8;
}

.rf-map-legend-segment {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}

.rf-map-legend-segment:nth-child(1) { background-color: #ffb000; }
.rf-map-legend-segment:nth-child(2) { background-color: #fe6100; }
.rf-map-legend-segment:nth-child(3) { background-color: #dc267f; }
.rf-map-legend-segment:nth-child(4) { background-color: #785ef0; }
.rf-map-legend-segment:nth-child(5) { background-color: #648fff; }

.rf-map-legend-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--rf-text-secondary, #6c757d);
}

.rf-chart-wrap-map canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.rf-chart-wrap-chord {
  min-height: 520px;
  height: 520px;
}

.rf-chart-wrap-chord svg {
  display: block;
  width: 100%;
  height: 100%;
}

.rf-chart-downloads {
  display: flex;
  gap: 0.5rem;
}

.rf-chart-download {
  border: 1px solid rgba(var(--rf-primary-rgb), 0.14);
  background: #fff;
  border-radius: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--rf-primary);
}

.rf-biblio-rec {
  border-left: 4px solid var(--rf-accent);
  padding: 0.75rem 0 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.rf-biblio-rec-warning {
  border-left-color: var(--rf-highlight);
}

.rf-biblio-rec-info {
  border-left-color: rgba(var(--rf-primary-rgb), 0.35);
}

.rf-biblio-rec-critical {
  border-left-color: var(--rf-highlight);
}

.rf-biblio-calc {
  padding: 0.75rem 0;
  border-top: 1px solid rgba(65, 42, 71, 0.08);
}

.rf-biblio-calc:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.rf-biblio-latex {
  overflow-x: auto;
  padding: 0.35rem 0 0.5rem;
}

.rf-biblio-latex .katex-display {
  margin: 0;
}

.rf-chart-wrap-wordcloud {
  min-height: 0;
}

.rf-chart-wrap-wordcloud canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#share-report .rf-share {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
}

#share-report .rf-share-label {
  width: 100%;
}

#share-report .rf-share-image-status {
  width: 100%;
  max-width: 36rem;
}
