:root {
  --parchment: #f9f7f1;
  --ink: #2b2b2b;
  --burgundy: #8b1538;
  --gold: #d4af37;
  --border: #d4c5b0;
  --shadow: rgba(43, 43, 43, 0.08);
}
body { 
  font-family: 'Crimson Text', 'Georgia', 'Garamond', serif;
  margin: 0;
  padding: 2rem;
  background: linear-gradient(to bottom, var(--parchment) 0%, #fefdfb 100%);
  color: var(--ink);
  line-height: 1.6;
  max-width: 1400px;
  margin: 0 auto;
}
.loading-indicator {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top, rgba(212, 175, 55, 0.18), transparent 40%),
    rgba(249, 247, 241, 0.92);
  backdrop-filter: blur(2px);
}
.loading-indicator-card {
  min-width: min(100%, 20rem);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 36px rgba(43, 43, 43, 0.12);
}
.loading-spinner {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 2px solid rgba(139, 21, 56, 0.2);
  border-top-color: var(--burgundy);
  border-radius: 999px;
  animation: loadingSpin 800ms linear infinite;
}
.loading-message {
  margin: 0;
  color: var(--burgundy);
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
h1 { 
  font-family: 'Cinzel', 'Georgia', serif;
  color: var(--burgundy);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 2px rgba(139, 21, 56, 0.1);
}
h1 a {
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
h1 a:hover {
  border-bottom-color: var(--gold);
}
code {
  background: rgba(212, 175, 55, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}
input[type="text"] { 
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  width: 26rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  font-family: 'Georgia', serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
}
select, button { 
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
button {
  background: var(--burgundy);
  color: white;
  border-color: var(--burgundy);
  font-weight: 500;
  letter-spacing: 0.3px;
}
button:hover {
  background: #6d1028;
  box-shadow: 0 2px 4px var(--shadow);
}
.link-btn {
  background: transparent;
  color: var(--burgundy);
  border: none;
  padding: 0.2rem 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
}
.link-btn:hover {
  background: transparent;
  color: #6d1028;
  box-shadow: none;
  text-decoration: underline;
}
.download-btn {
  background: #0f5b4d;
  border-color: #0f5b4d;
}
.download-btn:hover {
  background: #0b4a3e;
}
select:hover {
  border-color: var(--burgundy);
}
table { 
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
  background: white;
  box-shadow: 0 1px 3px var(--shadow);
  border-radius: 6px;
  overflow: hidden;
}
th, td { 
  border: 1px solid var(--border);
  padding: 0.7rem 0.8rem;
  text-align: left;
}
th { 
  background: linear-gradient(to bottom, #faf8f3 0%, #f0ede5 100%);
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--burgundy);
  letter-spacing: 0.3px;
  font-size: 0.95rem;
  border-bottom: 2px solid var(--border);
}
th:hover { 
  background: linear-gradient(to bottom, #f5f2ea 0%, #e8e4d8 100%);
}
th.sorted-asc::after { content: ' ▲'; color: var(--burgundy); }
th.sorted-desc::after { content: ' ▼'; color: var(--burgundy); }
th.dragging { opacity: 0.5; }
th.drag-over { border-left: 4px solid var(--burgundy); }
tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
}
tbody tr:nth-child(even) {
  background: rgba(249, 247, 241, 0.3);
}
tbody tr:nth-child(even):hover {
  background: rgba(212, 175, 55, 0.08);
}
td.ranked-cell {
  text-decoration: underline dotted rgba(91, 71, 56, 0.55);
  text-underline-offset: 0.2em;
}
@media (hover: hover) {
  td.ranked-cell { cursor: help; }
}
.rank-hint-bubble {
  position: fixed;
  z-index: 2600;
  max-width: min(320px, calc(100vw - 1rem));
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  background: rgba(33, 24, 20, 0.95);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.rank-hint-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}
.controls { 
  display:flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px var(--shadow);
  border: 1px solid var(--border);
}
.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  /* .controls is itself a flex container; make each row span it and shrink */
  flex: 1 1 100%;
  min-width: 0;
}
.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.control-group-grow {
  /* Zero basis so the group shares the toolbar line and squeezes (its own
     contents wrap internally) instead of dropping to a new line whole. */
  flex: 1 1 0;
  min-width: 0;
}
.control-divider {
  align-self: stretch;
  width: 1px;
  min-height: 1.6rem;
  background: var(--border);
}
/* On phones the table's "+" header cell sits off-screen to the right, so
   surface the same popover from a toolbar button instead. */
.add-columns-mobile {
  display: none;
  background: white;
  border: 1px solid var(--border);
  color: var(--burgundy);
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
}
.add-columns-mobile:hover {
  background: #f7efe6;
  box-shadow: none;
}
.add-column-btn {
  position: relative;
  overflow: visible;
  isolation: isolate;
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem;
}
.add-column-btn.idle-shimmer {
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.58), 0 0 0 7px rgba(212, 175, 55, 0.2), 0 10px 24px rgba(139, 21, 56, 0.18);
}
.add-column-btn::before,
.add-column-btn::after {
  content: '';
  position: absolute;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}
.add-column-btn::before {
  inset: -4px;
  border-radius: 8px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 292deg,
    rgba(255, 255, 255, 0.08) 308deg,
    rgba(255, 255, 255, 0.96) 324deg,
    rgba(255, 245, 196, 1) 338deg,
    rgba(212, 175, 55, 0.92) 350deg,
    transparent 360deg
  );
}
.add-column-btn::after {
  inset: -10px;
  border-radius: 12px;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 288deg,
    rgba(255, 255, 255, 0.04) 310deg,
    rgba(255, 255, 255, 0.26) 326deg,
    rgba(212, 175, 55, 0.56) 340deg,
    transparent 360deg
  );
  filter: blur(7px);
}
.add-column-btn.idle-shimmer::before {
  animation: addColumnShimmer 1900ms cubic-bezier(0.18, 0.7, 0.2, 1) 1;
}
.add-column-btn.idle-shimmer::after {
  animation: addColumnShimmerGlow 1900ms cubic-bezier(0.18, 0.7, 0.2, 1) 1;
}
.label-strong {
  font-weight: 600;
}
.control-select {
  font-size: 1rem;
}
.query-input {
  flex: 1;
  min-width: 13rem;
  font-size: 1rem;
}
.options-row {
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.commentator-column-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.commentator-column-filter {
  min-width: 14rem;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
}
.commentator-column-select {
  max-width: min(34rem, 100%);
}
.add-commentator-btn {
  background: white;
  color: var(--burgundy);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  padding: 0.35rem 0.7rem;
}
.add-commentator-btn:hover:not(:disabled) {
  background: var(--gold);
}
.add-commentator-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.selected-commentator-columns {
  flex-basis: 100%;
}
.commentator-filter-count {
  white-space: nowrap;
}
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0 -0.75rem;
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.active-filter-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.active-filter-chip {
  background: #f7efe6;
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  cursor: pointer;
}
.active-filter-chip strong {
  margin-right: 0.3rem;
}
.active-filter-chip:hover {
  background: #efe2d2;
  color: var(--burgundy);
  box-shadow: none;
}
.active-filter-chip .chip-x {
  margin-left: 0.35rem;
  color: #8a8a8a;
}
.active-filter-chip:hover .chip-x {
  color: var(--burgundy);
}
.link-btn-no-padding {
  padding: 0;
}
.vocab-names-toggle {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}
.muted { 
  color: #665544;
  font-size: 0.95rem;
  font-style: italic;
}
#playsFilter { 
  max-height: 8rem;
  overflow:auto;
  border: 1px solid var(--border);
  padding: 0.7rem;
  border-radius: 4px;
  background: white;
}
details {
  background: white;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px var(--shadow);
}
summary {
  cursor: pointer;
  padding: 0.5rem;
  user-select: none;
}
summary:hover {
  color: var(--burgundy);
}
#details { 
  margin-top: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px var(--shadow);
}
.hit { 
  background: rgba(212, 175, 55, 0.3);
  border-radius: 2px;
  box-shadow: 0 0 0 0.12em rgba(212, 175, 55, 0.3);
}
.sr { 
  font-size: 0.95rem;
  color: #554433;
}
.warning { 
  color: var(--burgundy);
  font-size: 0.9rem;
  font-style: italic;
}
label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 500;
}
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}
.tab-content {
  margin-top: 0;
}
.tab-content .controls {
  margin-top: 0;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px var(--shadow);
}
.pagination button {
  padding: 0.4rem 0.8rem;
  min-width: 2.5rem;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #ddd;
}
.pagination select {
  padding: 0.4rem 0.6rem;
}
.pagination .page-info {
  color: var(--ink);
  font-weight: 500;
}
#segmentsPagination {
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
}
#segmentsPagination button,
#segmentsPagination select {
  font-size: 0.92rem;
}
#segmentsPagination label {
  font-weight: 400;
}
.refresh-btn-pending {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
@keyframes addColumnShimmer {
  0% {
    transform: rotate(-120deg);
    opacity: 0;
  }
  14% {
    opacity: 0.7;
  }
  42% {
    opacity: 1;
  }
  78% {
    opacity: 0.92;
  }
  100% {
    transform: rotate(240deg);
    opacity: 0;
  }
}
@keyframes addColumnShimmerGlow {
  0% {
    transform: rotate(-120deg) scale(0.98);
    opacity: 0;
  }
  16% {
    opacity: 0.34;
  }
  48% {
    opacity: 0.7;
  }
  78% {
    opacity: 0.6;
  }
  100% {
    transform: rotate(240deg) scale(1.03);
    opacity: 0;
  }
}
@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .add-column-btn.idle-shimmer {
    box-shadow: none;
  }
  .add-column-btn.idle-shimmer::before {
    animation: none;
  }
  .add-column-btn.idle-shimmer::after {
    animation: none;
  }
  .loading-spinner {
    animation: none;
  }
}
/* Hide advanced color scale controls for now */
.color-scale-options { display: none; }
/* Color legend */
.legend-wrap { display: inline-flex; gap: 4px; align-items: center; margin-top: 4px; }
.legend-swatch { width: 26px; height: 14px; border: 1px solid var(--border); border-radius: 2px; display: inline-block; }
.legend-labels { display: flex; justify-content: space-between; gap: 2rem; font-size: 0.85rem; color: #665544; margin-top: 2px; max-width: 220px; }
/* Compact legend in the toolbar row above the results table */
.color-scale-legend-inline {
  width: fit-content;
  margin-left: auto;
}
.color-scale-legend-inline .legend-labels {
  max-width: none;
  gap: 0.5rem;
  font-size: 0.75rem;
}
/* Column filter UI */
th { position: sticky; }
.th-label { display: inline; }
.term-col-remove {
  margin-left: 0.35rem;
  border: none;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.12rem;
  vertical-align: middle;
}
.term-col-remove:hover {
  color: var(--burgundy);
}
.filter-icon { font-size: 0.9rem; margin-left: 0.4rem; color: #8a8a8a; cursor: pointer; }
.filter-icon:hover { color: var(--burgundy); }
.filter-popover {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 10px var(--shadow);
  padding: 0.6rem;
  min-width: 220px;
}
.filter-popover h4 { margin: 0 0 0.4rem 0; font-size: 0.95rem; color: var(--ink); }
.filter-popover .row { display: flex; gap: 0.5rem; align-items: center; margin: 0.3rem 0; }
.filter-popover input[type="text"], .filter-popover input[type="number"] { width: 100%; padding: 0.3rem 0.4rem; font-size: 0.95rem; }
.filter-popover .hint { font-size: 0.8rem; color: #7a6b5b; }
.filter-popover .actions { display: flex; justify-content: space-between; margin-top: 0.4rem; }
.filter-popover .link-btn { background: transparent; color: var(--burgundy); border: none; cursor: pointer; padding: 0.2rem 0.3rem; font-size: 0.9rem; }
th.add-column-th {
  width: 2.4rem;
  min-width: 2.4rem;
  text-align: center;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
}
th.add-column-th .add-column-plus {
  display: inline-block;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: var(--burgundy);
  cursor: pointer;
}
th.add-column-th .add-column-plus:hover {
  background: transparent;
  box-shadow: none;
}
td.add-column-cell {
  padding: 0;
}
.add-column-popover {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 10px var(--shadow);
  padding: 0.6rem;
  width: min(330px, calc(100vw - 1rem));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.add-column-search {
  width: 100%;
  padding: 0.35rem 0.45rem;
  font-size: 0.95rem;
}
.add-column-list {
  overflow: auto;
  max-height: min(340px, 55vh);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.add-column-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding: 0 0.35rem;
}
.add-column-group-head:first-child {
  margin-top: 0;
}
.add-column-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a6b5b;
}
.add-column-sort {
  display: flex;
  gap: 0.15rem;
  white-space: nowrap;
}
.add-column-sort .link-btn {
  font-size: 0.8rem;
}
.add-column-sort .link-btn.is-active {
  font-weight: 700;
  text-decoration: underline;
}
.add-column-option {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.28rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--ink);
}
.add-column-option:hover {
  background: rgba(139, 21, 56, 0.07);
  box-shadow: none;
}
.add-column-option .check {
  flex: 0 0 1rem;
  color: var(--burgundy);
  font-weight: 700;
}
.add-column-option .option-label {
  min-width: 0;
}
.add-column-option .count {
  margin-left: auto;
  color: #7a6b5b;
  font-size: 0.85rem;
}
.add-column-option.is-selected .option-label {
  font-weight: 600;
}
.add-column-empty {
  padding: 0.3rem 0.35rem;
  font-style: italic;
}
.add-column-footer {
  border-top: 1px solid var(--border);
  padding: 0.45rem 0.35rem 0;
  font-size: 0.85rem;
  color: #7a6b5b;
}.commentary-count-link,
.drill-link {
  background: transparent;
  border: none;
  /* Inherit the color-scale cell color so counts stay readable on any swatch */
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
.commentary-count-link:hover,
.drill-link:hover {
  background: transparent;
  box-shadow: none;
  color: inherit;
  text-decoration-thickness: 2px;
}.commentary-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 12, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  animation: playDetailFadeIn 0.2s ease-out;
}
.commentary-detail-overlay.open { display: flex; }
.commentary-detail-modal {
  width: min(1100px, calc(100vw - 2rem));
  max-height: 84vh;
  background: linear-gradient(to bottom, var(--parchment) 0%, #fefdfb 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.commentary-detail-head {
  position: relative;
  padding: 1rem 1.1rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
}
.commentary-detail-head h3 {
  margin: 0;
  color: var(--burgundy);
  line-height: 1.25;
  padding-right: 2.25rem;
}
.commentary-detail-meta {
  margin-top: 0.35rem;
  color: #5b4738;
  font-size: 0.95rem;
}
.commentary-detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid var(--border);
  background: white;
  color: var(--burgundy);
  font-size: 1.1rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  cursor: pointer;
}
.commentary-detail-close:hover { background: #f7efe6; }
.commentary-detail-body {
  overflow: auto;
  /* No top padding so the sticky table header hugs the scrollport edge */
  padding: 0 1.1rem 1.1rem;
}
.commentary-detail-loading {
  padding: 1.5rem 0.5rem;
  color: #5b4738;
  font-style: italic;
}
.commentary-detail-table {
  margin-top: 0;
  font-size: 0.92rem;
}
.commentary-detail-table th,
.commentary-detail-table td {
  padding: 0.45rem 0.6rem;
  vertical-align: top;
}
.commentary-detail-table th {
  z-index: 5;
}
.commentary-detail-table th.commentary-detail-unsortable {
  cursor: default;
}
.commentary-detail-table th.commentary-detail-unsortable:hover {
  background: linear-gradient(to bottom, #faf8f3 0%, #f0ede5 100%);
}
.commentary-ref-cell,
.commentary-link-cell {
  white-space: nowrap;
}
.commentary-work-cell {
  max-width: 13rem;
}
.commentary-work-ref {
  color: #6d5b4f;
  font-size: 0.88em;
}
.commentary-comment-cell {
  width: 55%;
}
.commentary-link-cell a {
  color: var(--burgundy);
  font-weight: 600;
}
.commentary-preview {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.commentary-preview-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.commentary-preview.is-expandable {
  cursor: pointer;
}
.commentary-preview-loading,
.commentary-preview-unavailable {
  color: #6d5b4f;
  font-style: italic;
}
.commentary-detail-pagination {
  margin: 0;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.72);
}
.commentary-detail-pagination button,
.commentary-detail-pagination select {
  font-size: 0.9rem;
}
.commentary-detail-pagination label {
  font-weight: 400;
}.excluded-terms-details {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #6d5b4f;
  font-size: 0.86rem;
}
.excluded-terms-details summary {
  padding: 0;
  color: inherit;
}
.excluded-terms-details summary:hover {
  color: #4f3a2e;
}
.excluded-terms-hint {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.82rem;
}
.excluded-terms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-height: 11rem;
  overflow: auto;
  margin: 0.35rem 0;
  padding: 0.15rem 0;
}
.excluded-term-chip {
  background: #f7efe6;
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  cursor: pointer;
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Frank Ruehl CLM', 'Noto Sans Hebrew', serif;
}
.excluded-term-chip:hover {
  background: #efe2d2;
  color: var(--burgundy);
  box-shadow: none;
}
.excluded-term-chip .chip-x {
  margin-left: 0.3rem;
  color: #8a8a8a;
}
.excluded-term-chip:hover .chip-x {
  color: var(--burgundy);
}
.excluded-terms-edit {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}
.excluded-terms-input {
  padding: 0.3rem 0.45rem;
  font-size: 0.95rem;
  min-width: 14rem;
}
.ngram-exclude-btn {
  background: transparent;
  border: none;
  color: #8a8a8a;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  opacity: 0.35;
}
tr:hover .ngram-exclude-btn {
  opacity: 1;
}
.ngram-exclude-btn:hover {
  color: var(--burgundy);
  background: transparent;
  box-shadow: none;
}
tr.pd-name-excluded td {
  opacity: 0.55;
}
@keyframes playDetailFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.site-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: #665544;
  font-size: 0.95rem;
}
.site-footer a {
  color: var(--burgundy);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}
@media (max-width: 900px) {
  body {
    padding: 1rem;
  }
  .controls-row {
    align-items: stretch;
  }
  .control-divider {
    display: none;
  }
  .add-columns-mobile {
    display: inline-block;
  }
  .control-group {
    width: 100%;
  }
  .query-input {
    min-width: 0;
    flex: 1 1 100%;
  }
  table {
    display: block;
    overflow-x: auto;
  }
}
.is-hidden {
  display: none !important;
}

/* Loading indicator */
.loading-indicator {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top, rgba(212, 175, 55, 0.18), transparent 40%),
    rgba(249, 247, 241, 0.92);
  backdrop-filter: blur(2px);
}
.loading-indicator-card {
  min-width: min(100%, 20rem);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 36px rgba(43, 43, 43, 0.12);
}
.loading-spinner {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 2px solid rgba(139, 21, 56, 0.2);
  border-top-color: var(--burgundy, #8b1538);
  border-radius: 999px;
  animation: loadingSpin 800ms linear infinite;
}
@keyframes loadingSpin { to { transform: rotate(360deg); } }
.loading-message {
  margin: 0;
  color: var(--burgundy, #8b1538);
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
#nameFilterEditor {
  margin: 1rem 0 -0.5rem;
}
