.cross-refs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  background: var(--overlay-bg);
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  opacity: 0;
  visibility: hidden;
}

.cross-refs-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.cross-refs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  flex-shrink: 0;
  min-height: 56px;
}

.cross-refs-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cross-refs-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.cross-refs-close:hover {
  background: var(--highlight);
  color: var(--fg);
}

.cross-refs-close svg {
  width: 24px;
  height: 24px;
}

.cross-refs-verse-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  flex-shrink: 0;
}

.cross-refs-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--ui-chrome);
  background: var(--bg);
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-family: var(--font-family-sans);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cross-refs-nav-btn:hover {
  background: var(--highlight);
  color: var(--fg);
  border-color: var(--fg-tertiary);
}

.cross-refs-nav-btn:active {
  transform: scale(0.98);
}

.cross-refs-nav-btn svg {
  flex-shrink: 0;
}

.cross-refs-filters {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cross-refs-filters::-webkit-scrollbar {
  display: none;
}

.cross-refs-filter-btn {
  padding: 6px 12px;
  border: 1px solid var(--ui-chrome);
  background: transparent;
  color: var(--fg-secondary);
  font-size: 0.8rem;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  font-family: var(--font-family-sans);
}

.cross-refs-filter-btn:hover {
  background: var(--highlight);
  color: var(--fg);
}

.cross-refs-filter-btn.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
  border-color: var(--button-primary);
}

.cross-refs-quality-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  flex-shrink: 0;
  font-family: var(--font-family-sans);
}

.cross-refs-quality-label {
  font-size: 0.8rem;
  color: var(--fg);
  white-space: nowrap;
}

.cross-refs-quality-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--slider-track);
  border-radius: 2px;
  outline: none;
}

.cross-refs-quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--slider-thumb);
  border-radius: 50%;
  cursor: pointer;
}

.cross-refs-quality-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--slider-thumb);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.cross-refs-quality-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  min-width: 32px;
  text-align: right;
}

.cross-refs-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.cross-refs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: var(--fg-secondary);
  gap: 12px;
}

.cross-refs-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--ui-chrome);
  border-top-color: var(--button-primary);
  border-radius: 50%;
  animation: cross-refs-spin 0.8s linear infinite;
}

@keyframes cross-refs-spin {
  to { transform: rotate(360deg); }
}

.cross-refs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--fg-secondary);
}

.cross-refs-empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.cross-refs-count {
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--fg-secondary);
  font-family: var(--font-family-sans);
  border-bottom: 1px solid var(--ui-chrome);
}

.cross-refs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cross-ref-item {
  padding: 16px;
  border-bottom: 1px solid var(--ui-chrome);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.cross-ref-item:hover {
  background: var(--highlight);
}

.cross-ref-item:active {
  background: var(--ui-chrome);
}

.cross-ref-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cross-ref-verse {
  font-weight: 600;
  color: var(--button-primary);
  font-size: 1rem;
}

.cross-ref-score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-family-sans);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.cross-ref-score.score-high {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

[data-theme="dark"] .cross-ref-score.score-high,
[data-theme="oled"] .cross-ref-score.score-high {
  background: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.cross-ref-score.score-medium {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}

[data-theme="dark"] .cross-ref-score.score-medium,
[data-theme="oled"] .cross-ref-score.score-medium {
  background: rgba(234, 179, 8, 0.25);
  color: #facc15;
}

.cross-ref-score.score-low {
  background: rgba(156, 163, 175, 0.15);
  color: #6b7280;
}

[data-theme="dark"] .cross-ref-score.score-low,
[data-theme="oled"] .cross-ref-score.score-low {
  background: rgba(156, 163, 175, 0.25);
  color: #9ca3af;
}

.cross-ref-score.score-pending {
  background: var(--highlight);
  color: var(--fg-tertiary);
}

.cross-ref-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.cross-ref-type {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ui-chrome);
  color: var(--fg-secondary);
  font-family: var(--font-family-sans);
  text-transform: capitalize;
}

.cross-ref-type.type-quotation {
  background: rgba(180, 83, 83, 0.12);
  color: #a04040;
}

.cross-ref-type.type-promise_fulfillment {
  background: rgba(120, 90, 160, 0.12);
  color: #7060a0;
}

.cross-ref-type.type-typology {
  background: rgba(160, 90, 130, 0.12);
  color: #a06080;
}

.cross-ref-type.type-verbal_parallel {
  background: rgba(70, 110, 160, 0.12);
  color: #4070a0;
}

.cross-ref-type.type-allusion {
  background: rgba(60, 140, 110, 0.12);
  color: #408070;
}

.cross-ref-type.type-doctrinal_argument {
  background: rgba(180, 140, 60, 0.12);
  color: #a08040;
}

[data-theme="dark"] .cross-ref-type.type-quotation,
[data-theme="oled"] .cross-ref-type.type-quotation {
  background: rgba(180, 100, 100, 0.2);
  color: #d09090;
}

[data-theme="dark"] .cross-ref-type.type-promise_fulfillment,
[data-theme="oled"] .cross-ref-type.type-promise_fulfillment {
  background: rgba(140, 110, 180, 0.2);
  color: #b0a0c0;
}

[data-theme="dark"] .cross-ref-type.type-typology,
[data-theme="oled"] .cross-ref-type.type-typology {
  background: rgba(180, 110, 150, 0.2);
  color: #d0a0b0;
}

[data-theme="dark"] .cross-ref-type.type-verbal_parallel,
[data-theme="oled"] .cross-ref-type.type-verbal_parallel {
  background: rgba(90, 130, 180, 0.2);
  color: #90b0d0;
}

[data-theme="dark"] .cross-ref-type.type-allusion,
[data-theme="oled"] .cross-ref-type.type-allusion {
  background: rgba(80, 160, 130, 0.2);
  color: #90c0b0;
}

[data-theme="dark"] .cross-ref-type.type-doctrinal_argument,
[data-theme="oled"] .cross-ref-type.type-doctrinal_argument {
  background: rgba(200, 160, 80, 0.2);
  color: #d0c090;
}

.cross-ref-verse-text {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--highlight);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.cross-ref-passage {
  font-family: var(--font-family-serif);
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.65;
  margin: 0;
  font-style: italic;
}

.cross-ref-citation {
  font-family: var(--font-family-sans);
  font-size: 0.8rem;
  color: var(--fg-secondary);
  margin: 6px 0 0 0;
  text-align: right;
}

.cross-ref-explanation-box {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--highlight);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.cross-ref-explanation {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.55;
  margin: 0;
}

.cross-ref-votes {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--fg-tertiary);
  font-family: var(--font-family-sans);
}

.cross-ref-votes svg {
  width: 12px;
  height: 12px;
}

.cross-ref-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 0;
  font-size: 0.8rem;
  color: var(--button-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family-sans);
}

.cross-ref-expand svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.cross-ref-expand.expanded svg {
  transform: rotate(180deg);
}

.cross-ref-detail {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ui-chrome);
}

.cross-ref-detail.visible {
  display: block;
}

.cross-ref-detail-text {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.55;
  margin: 0;
}

@media (min-width: 768px) {
  .cross-refs-overlay {
    inset: 5vh 10vw;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  }

  .cross-refs-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: -1;
  }

  .cross-refs-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #FFFFFF;
    border-radius: 12px;
    z-index: -1;
  }

  [data-theme="dark"] .cross-refs-overlay::after {
    background: #2C2C2E;
  }

  [data-theme="oled"] .cross-refs-overlay::after {
    background: #000000;
  }
}

/* Radial Chart View */
.cross-refs-view-toggle {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  flex-shrink: 0;
}

.cross-refs-view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--ui-chrome);
  background: transparent;
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-family: var(--font-family-sans);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cross-refs-view-btn:hover {
  background: var(--highlight);
  color: var(--fg);
}

.cross-refs-view-btn.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
  border-color: var(--button-primary);
}

.cross-refs-view-btn svg {
  width: 16px;
  height: 16px;
}

/* Chart Container */
.cross-refs-chart-container {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

[data-theme="dark"] .cross-refs-chart-container,
[data-theme="oled"] .cross-refs-chart-container {
  background: #1c1c1e;
}

.cross-refs-chart-container.active {
  display: flex;
}

.cross-refs-chart-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.cross-refs-chart-svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

/* Center Hub */
.chart-center-hub {
  cursor: default;
}

.chart-center-bg {
  fill: #ffffff;
  stroke: #e5e5ea;
  stroke-width: 2;
}

[data-theme="dark"] .chart-center-bg,
[data-theme="oled"] .chart-center-bg {
  fill: #2c2c2e;
  stroke: #48484a;
}

.chart-center-verse {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-family-sans);
  fill: var(--fg);
  text-anchor: middle;
  dominant-baseline: middle;
}

.chart-center-count {
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family-sans);
  fill: var(--fg-secondary);
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Radial Arc Segments */
.chart-arc {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.chart-arc:hover {
  opacity: 0.85;
}

.chart-arc:hover .chart-arc-path {
  filter: brightness(1.1);
}

.chart-arc:active {
  opacity: 0.7;
}

.chart-arc-path {
  transition: filter 0.15s ease;
}

.chart-arc-text {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-family-sans);
  fill: #ffffff;
  pointer-events: none;
  dominant-baseline: central;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Chart Sort Buttons */
.cross-refs-chart-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--ui-chrome);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.chart-sort-btn {
  padding: 10px 20px;
  border: 1px solid var(--ui-chrome);
  background: #ffffff;
  color: var(--fg-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-family-sans);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .chart-sort-btn,
[data-theme="oled"] .chart-sort-btn {
  background: #2c2c2e;
}

.chart-sort-btn:hover {
  background: var(--highlight);
  color: var(--fg);
}

.chart-sort-btn.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
  border-color: var(--button-primary);
}

/* Tooltip */
.chart-tooltip {
  position: absolute;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 0.85rem;
  font-family: var(--font-family-sans);
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  max-width: 280px;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip-verse {
  font-weight: 600;
  margin-bottom: 4px;
}

.chart-tooltip-score {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Navigation breadcrumb for chart */
.cross-refs-chart-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ui-chrome);
  font-family: var(--font-family-sans);
  font-size: 0.85rem;
  color: var(--fg-secondary);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cross-refs-chart-breadcrumb::-webkit-scrollbar {
  display: none;
}

.chart-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chart-breadcrumb-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--ui-chrome);
  color: var(--fg-secondary);
  font-size: 0.8rem;
  font-family: var(--font-family-sans);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chart-breadcrumb-btn:hover {
  background: var(--highlight);
  color: var(--fg);
}

.chart-breadcrumb-btn.current {
  background: var(--button-primary);
  color: var(--button-primary-fg);
  border-color: var(--button-primary);
  cursor: default;
}

.chart-breadcrumb-arrow {
  color: var(--fg-tertiary);
}

/* Chart Bar Action Sheet */
.chart-bar-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar-action-sheet.active {
  display: flex;
}

.chart-action-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.chart-action-content {
  position: relative;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: chart-action-slide-up 0.25s ease-out;
}

@keyframes chart-action-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.chart-action-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  text-align: center;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--ui-chrome);
  margin-bottom: 4px;
}

.chart-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: var(--highlight);
  color: var(--fg);
  font-size: 1rem;
  font-family: var(--font-family-sans);
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.chart-action-btn:hover {
  background: var(--ui-chrome);
}

.chart-action-btn svg {
  flex-shrink: 0;
  color: var(--button-primary);
}

.chart-action-cancel {
  margin-top: 8px;
  justify-content: center;
  background: transparent;
  color: var(--fg-secondary);
}

.chart-action-cancel:hover {
  background: var(--highlight);
}

/* List item highlight for navigation */
.cross-ref-highlight {
  animation: cross-ref-pulse 2.5s ease-out;
}

@keyframes cross-ref-pulse {
  0% { background: var(--button-primary); }
  100% { background: transparent; }
}

/* Comparison Panel */
.comparison-panel {
  background: var(--highlight);
  border: 1px solid var(--ui-chrome);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.comparison-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}

.comparison-close {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--fg-secondary);
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.comparison-close:hover {
  background: var(--ui-chrome);
  color: var(--fg);
}

.comparison-verses {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 600px) {
  .comparison-verses {
    flex-direction: row;
    align-items: stretch;
  }

  .comparison-verse {
    flex: 1;
  }

  .comparison-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
  }

  .comparison-arrow svg {
    transform: none;
  }
}

.comparison-verse {
  background: var(--bg);
  border: 1px solid var(--ui-chrome);
  border-radius: 10px;
  padding: 14px;
}

.comparison-source {
  border-left: 3px solid var(--button-primary);
}

.comparison-target {
  border-left: 3px solid #10b981;
}

.comparison-verse-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-tertiary);
  margin-bottom: 6px;
}

.comparison-verse-ref {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comparison-verse-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fg-secondary);
  font-style: italic;
  margin: 0;
}

.comparison-no-text {
  color: var(--fg-tertiary);
  font-style: normal;
}

.comparison-arrow {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  color: var(--fg-tertiary);
}

.comparison-arrow svg {
  transform: rotate(90deg);
}

.comparison-explanation {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ui-chrome);
}

.comparison-explanation-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-tertiary);
  margin-bottom: 8px;
}

.comparison-explanation p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--fg);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .cross-refs-chart-wrapper {
    padding: 10px;
  }

  .chart-bar-text {
    font-size: 7px;
  }

  .chart-center-verse {
    font-size: 14px;
  }

  .chart-center-count {
    font-size: 10px;
  }

  .cross-refs-chart-controls {
    padding: 12px;
    gap: 6px;
  }

  .chart-sort-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
}

/* ========================================
   Big List View - Vertical Bar Chart
   ======================================== */

.cross-refs-biglist-container {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

[data-theme="dark"] .cross-refs-biglist-container,
[data-theme="oled"] .cross-refs-biglist-container {
  background: #1c1c1e;
}

.cross-refs-biglist-container.active {
  display: flex;
}

/* Compact inline header */
.biglist-header-inline {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--ui-chrome);
}

.biglist-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  font-family: var(--font-family-sans);
}

.biglist-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-secondary);
}

/* Chart area with bars - takes most space */
.biglist-chart {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Individual bar */
.biglist-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.biglist-bar:hover {
  transform: scale(1.01);
}

.biglist-bar:active {
  opacity: 0.8;
  transform: scale(0.99);
}

.biglist-bar-fill {
  height: 100%;
  min-width: 50px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.biglist-bar-text {
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-family-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.biglist-bar-value {
  flex-shrink: 0;
  width: 28px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fg-secondary);
  font-family: var(--font-family-sans);
  text-align: right;
}

/* Sort controls at bottom (like chart) */
.biglist-controls {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--ui-chrome);
}

.biglist-sort-btn {
  padding: 8px 16px;
  border: 1px solid var(--ui-chrome);
  background: #ffffff;
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-family-sans);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .biglist-sort-btn,
[data-theme="oled"] .biglist-sort-btn {
  background: #2c2c2e;
}

.biglist-sort-btn:hover {
  background: var(--highlight);
  color: var(--fg);
}

.biglist-sort-btn.active {
  background: var(--button-primary);
  color: var(--button-primary-fg);
  border-color: var(--button-primary);
}

/* Responsive - mobile adjustments */
@media (max-width: 600px) {
  .biglist-header-inline {
    padding: 8px 12px;
  }
  
  .biglist-title {
    font-size: 1rem;
  }
  
  .biglist-chart {
    padding: 6px 10px;
    gap: 3px;
  }
  
  .biglist-bar {
    height: 28px;
  }
  
  .biglist-bar-fill {
    min-width: 40px;
    padding: 0 8px;
  }
  
  .biglist-bar-text {
    font-size: 0.75rem;
  }
  
  .biglist-bar-value {
    font-size: 0.75rem;
    width: 24px;
  }
  
  .biglist-controls {
    padding: 10px 12px;
    gap: 6px;
  }
  
  .biglist-sort-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}
