.demo-shell {
  background: #ffffff;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  color: #1f2933;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.bi-modal-open,
body.bi-modal-open {
  overflow: hidden;
}

html[data-bibtex-insight-theme="dark"] .demo-shell {
  background: #0a101b;
  color: #edf4ff;
}

.bibtex-insight {
  --bib-border: #d8dee8;
  --bib-muted: #5c697a;
  --bib-panel: #ffffff;
  --bib-accent: #00549f;
  --bib-accent-soft: #e6f0fa;
  --bib-ink: #182230;
  --bib-wash: #f4f7fb;
  --bib-line: rgba(0, 84, 159, 0.16);
  box-sizing: border-box;
  width: 100%;
  color: var(--bib-ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.bibtex-insight[data-theme="dark"] {
  --bib-border: #314256;
  --bib-muted: #a7b4c6;
  --bib-panel: #142033;
  --bib-accent: #8fd3ff;
  --bib-accent-soft: rgba(119, 183, 255, 0.16);
  --bib-ink: #edf4ff;
  --bib-wash: #0c1422;
  --bib-line: rgba(119, 183, 255, 0.18);
  background: transparent;
}

.bibtex-insight[data-theme="dark"] a,
.bibtex-insight[data-theme="dark"] .bi-links a,
.bibtex-insight[data-theme="dark"] .bi-link-button,
.bibtex-insight[data-theme="dark"] .bi-bar-count {
  color: #9ee7ff;
}

.bibtex-insight[data-theme="dark"] a:hover,
.bibtex-insight[data-theme="dark"] .bi-links a:hover,
.bibtex-insight[data-theme="dark"] .bi-link-button:hover,
.bibtex-insight[data-theme="dark"] .bi-bar-count:hover {
  color: #d5f6ff;
}

.bibtex-insight *,
.bibtex-insight *::before,
.bibtex-insight *::after {
  box-sizing: border-box;
}

.bibtex-insight .bi-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--bib-line);
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.bibtex-insight .bi-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.bibtex-insight .bi-input,
.bibtex-insight .bi-select,
.bibtex-insight .bi-textarea {
  width: 100%;
  border: 1px solid var(--bib-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--bib-ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bibtex-insight[data-theme="dark"] .bi-input,
.bibtex-insight[data-theme="dark"] .bi-select,
.bibtex-insight[data-theme="dark"] .bi-textarea {
  background: rgba(13, 23, 38, 0.92);
  color: var(--bib-ink);
}

.bibtex-insight .bi-input,
.bibtex-insight .bi-select {
  min-height: 38px;
  padding: 8px 10px;
}

.bibtex-insight .bi-input:focus,
.bibtex-insight .bi-select:focus,
.bibtex-insight .bi-textarea:focus {
  border-color: var(--bib-accent);
  box-shadow: 0 0 0 3px rgba(0, 84, 159, 0.13);
  outline: none;
}

.bibtex-insight .bi-textarea {
  min-height: 140px;
  resize: vertical;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bibtex-insight .bi-button {
  min-height: 38px;
  border: 1px solid var(--bib-accent);
  border-radius: 6px;
  background: linear-gradient(180deg, #0969bd 0%, var(--bib-accent) 100%);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 8px 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bibtex-insight .bi-button.secondary {
  background: rgba(255, 255, 255, 0.92);
  color: var(--bib-accent);
}

.bibtex-insight[data-theme="dark"] .bi-button {
  background: linear-gradient(180deg, #4f9dec 0%, #2274c7 100%);
  border-color: #77b7ff;
  color: #f8fbff;
}

.bibtex-insight[data-theme="dark"] .bi-button.secondary {
  background: rgba(13, 23, 38, 0.92);
  color: #b7d9ff;
}

.bibtex-insight .bi-button:hover {
  box-shadow: 0 8px 18px rgba(0, 84, 159, 0.14);
  transform: translateY(-1px);
}

.bibtex-insight .bi-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.bibtex-insight .bi-top-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.bibtex-insight .bi-top-controls:empty {
  display: none;
}

.bibtex-insight .bi-global-search {
  width: 100%;
}

.bibtex-insight .bi-top-row {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.bibtex-insight .bi-top-actions {
  align-items: end;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.bibtex-insight .bi-icon-button {
  align-items: center;
  border: 1px solid rgba(216, 222, 232, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--bib-ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 7px 9px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bibtex-insight[data-theme="dark"] .bi-icon-button {
  background: rgba(13, 23, 38, 0.72);
}

.bibtex-insight .bi-icon-button:hover {
  border-color: var(--bib-accent);
  color: var(--bib-accent);
}

.bibtex-insight .bi-icon-button[data-icon]::before {
  background: currentColor;
  content: "";
  display: block;
  height: 18px;
  width: 18px;
}

.bibtex-insight .bi-icon-button[data-icon="sun"]::before {
  clip-path: polygon(50% 0, 58% 30%, 85% 15%, 70% 42%, 100% 50%, 70% 58%, 85% 85%, 58% 70%, 50% 100%, 42% 70%, 15% 85%, 30% 58%, 0 50%, 30% 42%, 15% 15%, 42% 30%);
}

.bibtex-insight .bi-icon-button[data-icon="moon"]::before {
  background: transparent;
  border-radius: 50%;
  box-shadow: inset -6px 0 0 0 currentColor;
}

.bibtex-insight .bi-icon-button[data-icon="link"] {
  position: relative;
}

.bibtex-insight .bi-icon-button[data-icon="link"]::before,
.bibtex-insight .bi-icon-button[data-icon="link"]::after {
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 999px;
  content: "";
  display: block;
  height: 8px;
  left: 50%;
  position: absolute;
  top: 50%;
  width: 15px;
}

.bibtex-insight .bi-icon-button[data-icon="link"]::before {
  transform: translate(-11px, -1px) rotate(-35deg);
}

.bibtex-insight .bi-icon-button[data-icon="link"]::after {
  transform: translate(-4px, -7px) rotate(-35deg);
}

.bibtex-insight .bi-readme-button {
  min-width: 72px;
}

.bibtex-insight .bi-copy-status {
  align-items: center;
  color: var(--bib-muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-width: 44px;
}

.bibtex-insight .bi-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.bibtex-insight .bi-tab {
  border: 1px solid rgba(216, 222, 232, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--bib-ink);
  cursor: pointer;
  font: inherit;
  padding: 9px 12px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 100%;
}

.bibtex-insight[data-theme="dark"] .bi-tab {
  background: rgba(13, 23, 38, 0.72);
  color: var(--bib-ink);
}

.bibtex-insight .bi-tab[aria-selected="true"] {
  border-color: var(--bib-accent);
  background: var(--bib-accent);
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(0, 84, 159, 0.22);
}

.bibtex-insight[data-theme="dark"] .bi-tab[aria-selected="true"] {
  background: #8fd3ff;
  color: #08111f;
  box-shadow: 0 8px 18px rgba(143, 211, 255, 0.18);
}

.bibtex-insight .bi-panel {
  display: none;
}

.bibtex-insight .bi-panel.active {
  display: block;
}

.bibtex-insight .bi-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.bibtex-insight .bi-card,
.bibtex-insight .bi-entry,
.bibtex-insight .bi-empty,
.bibtex-insight .bi-error {
  border: 1px solid var(--bib-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(18, 33, 53, 0.06);
}

.bibtex-insight[data-theme="dark"] .bi-card,
.bibtex-insight[data-theme="dark"] .bi-entry,
.bibtex-insight[data-theme="dark"] .bi-empty,
.bibtex-insight[data-theme="dark"] .bi-error {
  background: rgba(20, 32, 51, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.bibtex-insight .bi-filter-stack {
  display: grid;
  gap: 10px;
}

.bibtex-insight .bi-filter-bar {
  align-items: end;
  border: 1px solid rgba(216, 222, 232, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 28px rgba(18, 33, 53, 0.06);
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 0;
  padding: 12px;
}

.bibtex-insight[data-theme="dark"] .bi-filter-bar,
.bibtex-insight[data-theme="dark"] .bi-results-head {
  background: rgba(13, 23, 38, 0.74);
}

.bibtex-insight .bi-reset-button {
  white-space: nowrap;
}

.bibtex-insight .bi-label {
  display: grid;
  gap: 5px;
  color: var(--bib-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bibtex-insight .bi-results-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(216, 222, 232, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  margin-bottom: 12px;
  padding: 10px;
}

.bibtex-insight .bi-count {
  color: var(--bib-muted);
  font-weight: 650;
}

.bibtex-insight .bi-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.bibtex-insight .bi-active-filters span,
.bibtex-insight .bi-analysis-note {
  border-radius: 999px;
  background: var(--bib-accent-soft);
  color: #003b70;
  display: inline-flex;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 8px;
}

.bibtex-insight[data-theme="dark"] .bi-active-filters span,
.bibtex-insight[data-theme="dark"] .bi-analysis-note,
.bibtex-insight[data-theme="dark"] .bi-entry-number,
.bibtex-insight[data-theme="dark"] button.bi-chip:hover {
  color: #d9ecff;
}

.bibtex-insight .bi-analysis-note {
  border-radius: 8px;
}

.bibtex-insight .bi-list {
  display: grid;
  gap: 10px;
  max-height: var(--bi-results-height, none);
  overflow: auto;
}

.bibtex-insight .bi-entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.bibtex-insight .bi-entry:hover {
  border-color: rgba(0, 84, 159, 0.34);
  box-shadow: 0 16px 34px rgba(18, 33, 53, 0.1);
  transform: translateY(-1px);
}

.bibtex-insight .bi-entry-number {
  align-items: center;
  align-self: start;
  background: var(--bib-accent-soft);
  border: 1px solid rgba(0, 84, 159, 0.2);
  border-radius: 8px;
  color: #003b70;
  display: inline-flex;
  font-size: 16px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  min-width: 36px;
}

.bibtex-insight .bi-entry-title {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.25;
  color: var(--bib-ink);
}

.bibtex-insight .bi-title-button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline;
  font: inherit;
  font-weight: 750;
  padding: 0;
  text-align: left;
}

.bibtex-insight .bi-title-button:hover {
  color: var(--bib-accent);
  text-decoration: underline;
}

.bibtex-insight .bi-highlight {
  background: transparent;
  color: inherit;
  font-weight: 800;
  padding: 0;
}

.bibtex-insight .bi-meta {
  color: var(--bib-muted);
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.bibtex-insight .bi-meta-authors {
  overflow-wrap: anywhere;
}

.bibtex-insight .bi-meta-pub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.bibtex-insight .bi-meta-venue {
  font-style: italic;
}

.bibtex-insight .bi-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.bibtex-insight .bi-chip {
  border: 0;
  border-radius: 999px;
  background: #edf4fb;
  color: #274966;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  font-size: 12px;
  font-family: inherit;
}

.bibtex-insight[data-theme="dark"] .bi-chip {
  background: rgba(119, 183, 255, 0.14);
  color: #d9ecff;
}

.bibtex-insight button.bi-chip {
  cursor: pointer;
}

.bibtex-insight button.bi-chip:hover {
  background: var(--bib-accent-soft);
  color: #003b70;
}

.bibtex-insight .bi-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.bibtex-insight .bi-links a,
.bibtex-insight .bi-link-button {
  background: none;
  border: 0;
  color: var(--bib-accent);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0;
  text-decoration: none;
}

.bibtex-insight .bi-links a:hover,
.bibtex-insight .bi-link-button:hover {
  text-decoration: underline;
}

.bibtex-insight .bi-journal {
  color: #334155;
  font-style: italic;
  margin-top: -2px;
}

.bibtex-insight .bi-abstract {
  color: #334155;
  margin: 8px 0 0;
}

.bibtex-insight[data-theme="dark"] .bi-journal,
.bibtex-insight[data-theme="dark"] .bi-abstract {
  color: #c2cedd;
}

.bibtex-insight .bi-bibtex {
  background: #111827;
  border-radius: 6px;
  color: #e5e7eb;
  margin: 10px 0 0;
  overflow-x: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.bibtex-insight[data-theme="dark"] .bi-bibtex {
  background: #050914;
  color: #e8eef7;
}

.bibtex-insight .bi-detail {
  border: 1px solid rgba(0, 84, 159, 0.16);
  border-radius: 8px;
  background: #f8fbff;
  margin-top: 12px;
  padding: 12px;
}

.bibtex-insight[data-theme="dark"] .bi-detail,
.bibtex-insight[data-theme="dark"] .bi-modal-analysis div {
  background: rgba(13, 23, 38, 0.72);
}

.bibtex-insight .bi-detail-abstract {
  border-bottom: 1px solid rgba(0, 84, 159, 0.12);
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.bibtex-insight .bi-detail-abstract p {
  margin: 6px 0 0;
}

.bibtex-insight .bi-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.bibtex-insight .bi-detail-grid div {
  min-width: 0;
}

.bibtex-insight .bi-detail-grid dt {
  color: var(--bib-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bibtex-insight .bi-detail-grid dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.bibtex-insight .bi-modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 9999;
}

.bibtex-insight .bi-modal {
  background: #ffffff;
  border: 1px solid rgba(0, 84, 159, 0.22);
  border-radius: 12px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.34);
  color: var(--bib-ink);
  max-height: min(860px, calc(100vh - 44px));
  max-width: 900px;
  overflow: auto;
  padding: 20px;
  position: relative;
  width: min(900px, 100%);
}

.bibtex-insight[data-theme="dark"] .bi-modal {
  background: #101b2c;
  border-color: rgba(119, 183, 255, 0.32);
  color: var(--bib-ink);
}

.bibtex-insight .bi-modal-close {
  align-items: center;
  background: #eef2f6;
  border: 0;
  border-radius: 999px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
}

.bibtex-insight[data-theme="dark"] .bi-modal-close {
  background: rgba(119, 183, 255, 0.14);
  color: #d9ecff;
}

.bibtex-insight .bi-modal-close:hover {
  background: var(--bib-accent-soft);
  color: #003b70;
}

.bibtex-insight .bi-modal-head {
  padding-right: 42px;
}

.bibtex-insight .bi-modal-kicker {
  color: var(--bib-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bibtex-insight .bi-modal h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 5px 0 8px;
}

.bibtex-insight .bi-modal-head p {
  color: var(--bib-muted);
  margin: 0 0 10px;
}

.bibtex-insight .bi-modal-links {
  margin-bottom: 12px;
}

.bibtex-insight .bi-modal-analysis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.bibtex-insight .bi-modal-analysis div {
  border: 1px solid rgba(216, 222, 232, 0.9);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.bibtex-insight .bi-modal-analysis span {
  color: var(--bib-muted);
  display: block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bibtex-insight .bi-modal-analysis strong {
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.bibtex-insight .bi-modal-actions {
  margin-top: 12px;
}

.bibtex-insight .bi-doc-modal {
  max-width: 980px;
}

.bibtex-insight .bi-doc-content {
  border-top: 1px solid var(--bib-border);
  margin-top: 14px;
  padding-top: 12px;
}

.bibtex-insight .bi-doc-content h2,
.bibtex-insight .bi-doc-content h3,
.bibtex-insight .bi-doc-content h4 {
  margin: 18px 0 8px;
}

.bibtex-insight .bi-doc-content p,
.bibtex-insight .bi-doc-content li {
  color: var(--bib-ink);
}

.bibtex-insight .bi-doc-content pre {
  background: #111827;
  border-radius: 6px;
  color: #e5e7eb;
  overflow: auto;
  padding: 10px;
}

.bibtex-insight .bi-doc-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bibtex-insight .bi-doc-content table {
  border-collapse: collapse;
  display: block;
  margin: 10px 0;
  overflow: auto;
  width: 100%;
}

.bibtex-insight .bi-doc-content td {
  border: 1px solid var(--bib-border);
  padding: 6px 8px;
  vertical-align: top;
}

.bibtex-insight .bi-doc-fallback {
  border-top: 1px solid var(--bib-border);
  margin-top: 14px;
  padding-top: 12px;
}

.bibtex-insight .bi-analysis-items-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.bibtex-insight .bi-analysis-items-filter {
  margin-top: 12px;
}

.bibtex-insight .bi-analysis-item {
  border: 1px solid var(--bib-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--bib-ink);
  display: grid;
  gap: 3px;
  padding: 10px;
}

.bibtex-insight .bi-analysis-item-toggle {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 3px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.bibtex-insight .bi-analysis-item.expanded {
  background: #f8fbff;
}

.bibtex-insight[data-theme="dark"] .bi-analysis-item {
  background: rgba(13, 23, 38, 0.72);
}

.bibtex-insight[data-theme="dark"] .bi-analysis-item.expanded {
  background: rgba(20, 32, 51, 0.96);
}

.bibtex-insight .bi-analysis-item:hover {
  border-color: var(--bib-accent);
  background: var(--bib-accent-soft);
}

.bibtex-insight .bi-analysis-item-toggle span {
  color: var(--bib-muted);
  font-size: 12px;
}

.bibtex-insight .bi-analysis-item-detail {
  cursor: default;
  margin-top: 8px;
}

.bibtex-insight .bi-analysis-item .bi-detail {
  margin-top: 0;
  text-align: left;
}

.bibtex-insight .bi-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.bibtex-insight .bi-analysis-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 2fr);
  gap: 12px;
  margin-bottom: 12px;
}

.bibtex-insight .bi-coauthor-card {
  margin-bottom: 12px;
}

.bibtex-insight .bi-coauthor-head {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 12px;
  margin-bottom: 10px;
}

.bibtex-insight .bi-coauthor-head p {
  color: var(--bib-muted);
  margin: 4px 0 0;
}

.bibtex-insight .bi-coauthor-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bibtex-insight .bi-network-wrap {
  border: 1px solid var(--bib-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  overflow: auto;
  padding: 10px;
  position: relative;
}

.bibtex-insight[data-theme="dark"] .bi-network-wrap {
  background: rgba(13, 23, 38, 0.58);
}

.bibtex-insight .bi-network {
  display: block;
  min-width: 620px;
  width: 100%;
  cursor: grab;
  touch-action: none;
}

.bibtex-insight .bi-network.panning {
  cursor: grabbing;
}

.bibtex-insight .bi-network-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.bibtex-insight .bi-network-button {
  border: 1px solid var(--bib-border);
  border-radius: 6px;
  background: var(--bib-panel);
  color: var(--bib-ink);
  cursor: pointer;
  font: inherit;
  min-height: 30px;
  padding: 4px 9px;
}

.bibtex-insight .bi-network-button:hover {
  border-color: var(--bib-accent);
  color: var(--bib-accent);
}

.bibtex-insight .bi-network-edges line {
  stroke: rgba(0, 84, 159, 0.32);
  transition: opacity 0.15s ease, stroke 0.15s ease, stroke-width 0.15s ease;
}

.bibtex-insight[data-theme="dark"] .bi-network-edges line {
  stroke: rgba(158, 231, 255, 0.32);
}

.bibtex-insight .bi-network-nodes circle {
  fill: var(--bib-accent-soft);
  stroke: var(--bib-accent);
  stroke-width: 2;
  cursor: grab;
  transition: opacity 0.15s ease, stroke-width 0.15s ease, fill 0.15s ease;
}

.bibtex-insight .bi-network-node.dragging circle {
  cursor: grabbing;
}

.bibtex-insight .bi-network-nodes text {
  fill: var(--bib-ink);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 3px;
  transition: opacity 0.15s ease;
}

.bibtex-insight[data-theme="dark"] .bi-network-nodes text {
  stroke: rgba(10, 16, 27, 0.9);
}

.bibtex-insight .bi-network-caption {
  color: var(--bib-muted);
  font-size: 12px;
  margin-top: 8px;
}

.bibtex-insight .bi-network.highlighting .bi-network-edge,
.bibtex-insight .bi-network.highlighting .bi-network-node circle {
  opacity: 0.12;
}

.bibtex-insight .bi-network .bi-network-edge.highlight {
  opacity: 0.95;
  stroke: var(--bib-accent);
}

.bibtex-insight .bi-network .bi-network-node.highlight circle,
.bibtex-insight .bi-network-node:hover circle,
.bibtex-insight .bi-network-node.dragging circle {
  fill: var(--bib-accent);
  opacity: 1;
  stroke-width: 3;
}

.bibtex-insight .bi-network .bi-network-node.highlight text,
.bibtex-insight .bi-network-node:hover text,
.bibtex-insight .bi-network-node.dragging text {
  opacity: 1;
}

.bibtex-insight .bi-analysis-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bibtex-insight .bi-analysis-card-head {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
  gap: 8px;
  margin-bottom: 8px;
}

.bibtex-insight .bi-analysis-card-head .bi-entry-title {
  margin: 0;
}

.bibtex-insight .bi-analysis-filter {
  min-height: 32px;
  padding: 5px 8px;
}

.bibtex-insight .bi-year-card .bi-bars {
  max-height: 220px;
}

.bibtex-insight .bi-card {
  padding: 12px;
  overflow: hidden;
}

.bibtex-insight .bi-scroll-card .bi-bars {
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.bibtex-insight .bi-stat {
  color: var(--bib-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bibtex-insight .bi-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 750;
  margin-top: 2px;
}

.bibtex-insight .bi-bars {
  display: grid;
  gap: 8px;
}

.bibtex-insight .bi-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 170px) minmax(80px, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.bibtex-insight .bi-bar-count {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--bib-accent);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 3px 5px;
  text-align: right;
}

.bibtex-insight .bi-bar-count:hover {
  background: var(--bib-accent-soft);
  text-decoration: underline;
}

.bibtex-insight .bi-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bibtex-insight .bi-bar {
  height: 10px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
}

.bibtex-insight[data-theme="dark"] .bi-bar {
  background: #223248;
}

.bibtex-insight .bi-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bib-accent), #4ea3e7);
}

.bibtex-insight .bi-drop {
  border: 1px dashed #a8b4c4;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.bibtex-insight[data-theme="dark"] .bi-drop {
  background: rgba(13, 23, 38, 0.92);
}

.bibtex-insight .bi-empty,
.bibtex-insight .bi-error {
  padding: 16px;
}

.bibtex-insight .bi-empty-source-title {
  color: var(--bib-ink);
  font-size: 24px;
  line-height: 1.2;
  margin: 18px auto 12px;
  max-width: 760px;
}

.bibtex-insight .bi-empty-source {
  border: 1px solid var(--bib-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(18, 33, 53, 0.06);
  margin: 18px auto;
  max-width: 760px;
  padding: 22px;
}

.bibtex-insight[data-theme="dark"] .bi-empty-source {
  background: rgba(20, 32, 51, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.bibtex-insight .bi-empty-source h2 {
  margin: 0 0 6px;
}

.bibtex-insight .bi-empty-source p {
  color: var(--bib-muted);
  margin: 0 0 14px;
}

.bibtex-insight .bi-empty-source-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
}

.bibtex-insight .bi-empty-source-actions {
  border-top: 1px solid var(--bib-border);
  margin-top: 18px;
  padding-top: 14px;
}

.bibtex-insight .bi-empty-source-readme {
  width: 100%;
}

.bibtex-insight .bi-empty-source-divider {
  align-items: center;
  color: var(--bib-muted);
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.bibtex-insight .bi-empty-source-divider::before,
.bibtex-insight .bi-empty-source-divider::after {
  background: var(--bib-border);
  content: "";
  flex: 1;
  height: 1px;
}

.bibtex-insight .bi-upload-box {
  align-items: center;
  border: 1px dashed var(--bib-border);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 14px;
}

.bibtex-insight .bi-upload-box:hover {
  border-color: var(--bib-accent);
  background: var(--bib-accent-soft);
}

.bibtex-insight .bi-upload-box span {
  color: var(--bib-muted);
  font-weight: 650;
}

.bibtex-insight .bi-error {
  border-color: #d64545;
  color: #8a1f1f;
}

.bibtex-insight[data-theme="dark"] .bi-error {
  border-color: #ff8f8f;
  color: #ffd2d2;
}

@media (max-width: 820px) {
  .demo-shell {
    padding: 14px;
  }

  .bibtex-insight .bi-grid,
  .bibtex-insight .bi-analysis-grid,
  .bibtex-insight .bi-analysis-layout,
  .bibtex-insight .bi-analysis-list-grid {
    grid-template-columns: 1fr;
  }

  .bibtex-insight .bi-analysis-card-head {
    grid-template-columns: 1fr;
  }

  .bibtex-insight .bi-coauthor-head,
  .bibtex-insight .bi-coauthor-controls {
    grid-template-columns: 1fr;
  }

  .bibtex-insight .bi-title {
    font-size: 23px;
  }

  .bibtex-insight {
    padding: 0;
  }

  .bibtex-insight .bi-entry {
    grid-template-columns: 1fr;
  }

  .bibtex-insight .bi-entry-number {
    height: 30px;
    min-width: 30px;
  }

  .bibtex-insight .bi-detail-grid {
    grid-template-columns: 1fr;
  }

  .bibtex-insight .bi-modal-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .bibtex-insight .bi-modal {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .bibtex-insight .bi-modal-analysis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1120px) {
  .bibtex-insight .bi-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .bibtex-insight .bi-top-row {
    grid-template-columns: 1fr;
  }

  .bibtex-insight .bi-top-actions {
    justify-content: flex-start;
  }

  .bibtex-insight .bi-filter-bar {
    grid-template-columns: 1fr;
  }

  .bibtex-insight .bi-empty-source-form {
    grid-template-columns: 1fr;
  }
}
