/* --------------------------------------------------------------- database */

/* The landing page follows the ZcurveHub database layout: a dark header box,
   three statistic panels, then one card per kingdom. */

.db-hero {
  position: relative;
  padding: 30px 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0a2463 0%, #1e3d8b 100%);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(10, 36, 99, 0.25);
}

.db-hero-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #e6ecf8;
  font-size: 12.5px;
}

.db-hero-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.db-hero-sub {
  margin: 12px 0 0;
  max-width: 780px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.6;
}

.db-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 26px 0 8px;
}

.db-stat {
  flex: 1 1 220px;
  padding: 22px 24px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(15, 30, 60, 0.07);
  text-align: center;
}

.db-stat span {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: #0a2463;
  font-variant-numeric: tabular-nums;
}

.db-stat label {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 13.5px;
}

.db-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
}

.db-fact {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fbfcfe;
}

.db-fact strong {
  display: block;
  color: #0a2463;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.db-fact span {
  display: block;
  margin-top: 2px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.db-fact small {
  display: block;
  margin-top: 4px;
  color: #7a8796;
  font-size: 11.5px;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .db-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .db-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .db-facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

.db-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 34px 0 6px;
  color: #1f2937;
  font-size: 21px;
  font-weight: 600;
}

.db-section-note {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-soft);
  font-size: 14px;
}

.db-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.db-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 150px;
  padding: 22px;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(15, 30, 60, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.db-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(15, 30, 60, 0.22);
}

.db-card:focus-visible {
  outline: 3px solid #4dabf7;
  outline-offset: 2px;
}

.db-card strong {
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.db-card em {
  margin-top: 6px;
  font-style: normal;
  font-size: 13.5px;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* the pictures are the ones the ZcurveHub database used for its cards */
.db-card {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* a dark wash at the bottom keeps the label readable over any picture */
.db-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(6, 15, 32, 0.82) 0%,
    rgba(6, 15, 32, 0.35) 45%,
    rgba(6, 15, 32, 0.05) 100%
  );
}

.db-card strong,
.db-card em {
  position: relative;
  z-index: 1;
}

.db-card.bacteria {
  background-image: url('img/database/bacteria.png');
}

.db-card.archaea {
  background-image: url('img/database/archaea.png');
}

.db-card.fungi {
  background-image: url('img/database/fungi.png');
}

.db-card.animals {
  background-image: url('img/database/animals.png');
}

.db-card.plants {
  background-image: url('img/database/plants.png');
}

.db-card.viruses {
  background-image: url('img/database/viruses.png');
}

.db-card.plasmids {
  background-image: url('img/database/plasmid.png');
}

.db-card.mitochondria {
  background-image: url('img/database/mitochondria.png');
}

.db-card.chloroplasts {
  background-image: url('img/database/chloroplasts.png');
}

/* ------------------------------------------------------------------ list */

:root {
  --db-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%235b6b82' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.db-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
}

.db-bar input[type='search'] {
  flex: 1 1 260px;
  min-width: 180px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.db-bar select,
.db-replicon-field select,
.db-preview-head select,
.db-pager .page-size select,
.db-islands-filter select {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--db-select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.db-bar select {
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid #cfd8e3;
  border-radius: 9px;
  background-color: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.db-bar select:hover,
.db-replicon-field select:hover,
.db-preview-head select:hover,
.db-pager .page-size select:hover,
.db-islands-filter select:hover {
  border-color: #aebed2;
  background-color: #f8fbff;
}

.db-bar select:focus-visible,
.db-replicon-field select:focus-visible,
.db-preview-head select:focus-visible,
.db-pager .page-size select:focus-visible,
.db-islands-filter select:focus-visible {
  outline: none;
  border-color: #0a58ca;
  box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.16);
}

.db-bar select:disabled,
.db-replicon-field select:disabled,
.db-preview-head select:disabled,
.db-pager .page-size select:disabled,
.db-islands-filter select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.db-bar select option,
.db-replicon-field select option,
.db-preview-head select option,
.db-pager .page-size select option,
.db-islands-filter select option {
  background: #ffffff;
  color: #1e293b;
}

.db-custom-select {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.db-custom-select > select {
  display: none !important;
}

.db-select-trigger {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 9px;
  background-color: #ffffff;
  background-image: var(--db-select-chevron);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 8px;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.db-select-trigger:hover {
  border-color: #aebed2;
  background-color: #f8fbff;
}

.db-select-trigger:focus-visible,
.db-select-trigger[aria-expanded='true'] {
  outline: none;
  border-color: #0a58ca;
  box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.16);
}

.db-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.db-select-trigger[data-static='true'] {
  padding-right: 10px;
  border-color: #e2e8f0;
  background-color: #f6f8fb;
  background-image: none;
  color: #475569;
  cursor: default;
  box-shadow: none;
  opacity: 1;
}

.db-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-bar .db-select-trigger {
  height: 38px;
  min-width: 124px;
  max-width: 240px;
  padding: 0 36px 0 12px;
  border-radius: 9px;
}

.db-replicon-field .db-select-trigger {
  min-width: 120px;
  max-width: 380px;
  padding: 5px 30px 5px 8px;
  border-color: var(--border);
  border-radius: 7px;
  font-weight: 500;
}

.db-preview-head .db-select-trigger {
  min-width: 112px;
  padding: 7px 32px 7px 10px;
  border-color: var(--border);
  border-radius: 8px;
  font-weight: 500;
}

.db-pager .page-size .db-select-trigger {
  height: 30px;
  min-width: 58px;
  padding: 5px 28px 5px 8px;
  border-color: var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: none;
}

.db-islands-filter .db-select-trigger {
  height: 30px;
  min-width: 98px;
  padding: 0 28px 0 8px;
  border-color: var(--border-soft);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}

.db-select-menu {
  position: fixed;
  z-index: 10000;
  box-sizing: border-box;
  max-height: min(320px, 56vh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #ffffff;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.18),
    0 4px 12px rgba(15, 23, 42, 0.08);
  animation: db-select-open 0.13s ease-out;
}

.db-select-menu[hidden] {
  display: none;
}

.db-select-option {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 34px 9px 11px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.db-select-option:hover,
.db-select-option:focus-visible {
  outline: none;
  background: #eef6ff;
  color: #0a58ca;
}

.db-select-option[aria-selected='true'] {
  background: #e7f1ff;
  color: #0a2463;
  font-weight: 650;
}

.db-select-option[aria-selected='true']::after {
  content: '✓';
  position: absolute;
  right: 12px;
  color: #0a58ca;
}

.db-select-option:disabled {
  background: transparent;
  color: #a0aab8;
  cursor: not-allowed;
}

@keyframes db-select-open {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.db-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.db-vshape-filter {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 13px;
}

.db-vshape-filter legend {
  padding: 0 3px;
  color: var(--ink-muted);
  font-size: 11.5px;
}

.db-vshape-filter label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.db-vshape-filter input {
  margin: 0;
  accent-color: #0a2463;
}

.db-count {
  margin-left: auto;
  min-width: 15ch;
  color: var(--ink-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.db-table-wrap {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: auto;
}

.db-table {
  width: 100%;
  min-width: 1320px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #ffffff;
}

#db-landing-results .db-table th:nth-child(1) { width: 24%; }
#db-landing-results .db-table th:nth-child(2) { width: 7%; }
#db-landing-results .db-table th:nth-child(3) { width: 7%; }
#db-landing-results .db-table th:nth-child(4) { width: 7%; }
#db-landing-results .db-table th:nth-child(5) { width: 7%; }
#db-landing-results .db-table th:nth-child(6) { width: 6%; }
#db-landing-results .db-table th:nth-child(7) { width: 8%; }
#db-landing-results .db-table th:nth-child(8) { width: 7%; }
#db-landing-results .db-table th:nth-child(9) { width: 7%; }
#db-landing-results .db-table th:nth-child(10) { width: 8%; }
#db-landing-results .db-table th:nth-child(11) { width: 12%; }

#db-list .db-table th:nth-child(1) { width: 28%; }
#db-list .db-table th:nth-child(2) { width: 7%; }
#db-list .db-table th:nth-child(3) { width: 7%; }
#db-list .db-table th:nth-child(4) { width: 7%; }
#db-list .db-table th:nth-child(5) { width: 6%; }
#db-list .db-table th:nth-child(6) { width: 8%; }
#db-list .db-table th:nth-child(7) { width: 8%; }
#db-list .db-table th:nth-child(8) { width: 8%; }
#db-list .db-table th:nth-child(9) { width: 8%; }
#db-list .db-table th:nth-child(10) { width: 13%; }

.db-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  background: linear-gradient(180deg, #f8f9fa, #f1f3f5);
  border-bottom: 1px solid var(--border-soft);
  color: #1e293b;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.db-table td {
  padding: 10px 14px;
  overflow: hidden;
  border-bottom: 1px solid #f1f3f5;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-table tbody tr {
  cursor: pointer;
}

.db-table tbody tr:hover {
  background: #f1f8ff;
}

.db-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.db-table .mono {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 12.5px;
  color: #64748b;
}

.db-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Every enabled control wears the same blue as the page number that marks where
   the reader is; a spent one fades out of the way. The current page keeps that
   fill and adds a light inner ring, so it is still the one that reads as chosen. */
.db-pager .button {
  min-width: 92px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #0a2463;
  border-radius: 8px;
  background: #0a2463;
  color: #ffffff;
  font-weight: 600;
  box-shadow: none;
  justify-content: center;
  white-space: nowrap;
}

.db-pager .button:not(:disabled):hover {
  background: #16387a;
  border-color: #16387a;
}

.db-pager .button[data-act='prev'],
.db-pager .button[data-act='next'] {
  width: 92px;
  min-width: 92px;
  flex: 0 0 92px;
}

.db-pager .page-number {
  width: 48px;
  min-width: 48px;
  flex: 0 0 48px;
  padding: 6px 0;
  border: 1px solid #b9c2d0;
  border-radius: 8px;
  background: #ffffff;
  color: #0a2463;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.db-pager .page-number:hover:not(.active) {
  border-color: #0a2463;
  background: #eef4ff;
}

.db-pager .page-number.active {
  border-color: #0a2463;
  background: #0a2463;
  color: #ffffff;
  font-weight: 700;
}

.db-pager .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 360px;
  min-width: 360px;
  flex: 0 0 360px;
  justify-content: center;
}

.db-pager .page-gap {
  width: 48px;
  flex: 0 0 48px;
  padding: 0 2px;
  color: var(--ink-muted);
  text-align: center;
  user-select: none;
}

.db-pager .page-edge {
  width: 34px;
  min-width: 34px;
  flex: 0 0 34px;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1;
}

/* the page-wide rule paints every spent button grey with !important; the pager
   wants it quieter than that, so this one out-specifies it */
.db-pager .button:disabled {
  border-color: #e4e8ee;
  background: #f4f6f9 !important;
  color: #a3abb6;
  cursor: not-allowed;
}

.db-pager .page-info {
  width: 36ch;
  min-width: 36ch;
  flex: 0 0 36ch;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.db-pager .page-jump,
.db-pager .page-size {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.db-pager .page-jump input {
  width: 62px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  color: #343a40;
  text-align: center;
}

.db-pager .page-jump input:focus {
  outline: none;
  border-color: var(--accent);
}

.db-pager .page-size select {
  padding: 5px 28px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: #ffffff;
  font-size: 12.5px;
  color: #343a40;
  cursor: pointer;
}

.db-pager .page-size select:focus {
  outline: none;
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .db-pager {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .db-pager .page-info {
    order: 10;
    width: 100%;
    min-width: 100%;
    flex-basis: 100%;
  }

  .db-pager .page-numbers {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    flex-wrap: wrap;
  }
}

.db-pager .page-info {
  margin-left: auto;
}

/* ---------------------------------------------------------------- detail */

.db-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0;
  border: none;
  background: none;
  color: #1c7ed6;
  font-size: 13.5px;
  cursor: pointer;
}

.db-back:hover {
  text-decoration: underline;
}

.db-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 6px 0 20px;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 12px rgba(15, 30, 60, 0.06);
  font-size: 14px;
}

.db-info-item {
  display: grid;
  grid-template-columns: minmax(130px, 0.36fr) minmax(0, 1fr);
  min-width: 0;
}

.db-info-key,
.db-info-value {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 12px 18px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid #f0f0f0;
}

.db-info-key {
  background: linear-gradient(135deg, #f8f9fa, #f1f4f7);
  color: #1e293b;
  font-weight: 600;
  text-align: left;
}

.db-info-value {
  margin: 0;
  color: #475569;
}

.db-info-value-inner {
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .db-info {
    grid-template-columns: minmax(0, 1fr);
  }
}

.db-origin-candidates {
  color: #64748b;
  font-size: 11px;
}

.db-origin-candidates a {
  color: #1c7ed6;
  text-decoration: none;
}

.db-origin-candidates a:hover {
  text-decoration: underline;
}

.db-origin {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 1px;
  border-left: 1px dashed rgba(34, 139, 230, 0.72);
  color: #1c7ed6;
  font-size: 9px;
  line-height: 14px;
  text-indent: 3px;
  pointer-events: none;
}

.db-origin.is-best {
  border-left: 2px solid #e8590c;
  color: #d9480f;
  font-weight: 700;
}

.db-v-turn {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 1px;
  border-left: 1px solid currentColor;
  color: #0a2463;
  pointer-events: none;
}

.db-v-turn.is-ter {
  border-left-style: dashed;
}

.db-v-turn-label {
  position: absolute;
  top: calc(8px + var(--label-offset, 0px));
  left: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: currentColor;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  white-space: nowrap;
}

.db-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.db-badge.is-yes {
  background: #e6fcf5;
  color: #087f5b;
}

.db-badge.is-no {
  background: #fff4e6;
  color: #d9480f;
}

.db-badge.is-not-applicable {
  background: #f1f3f5;
  color: #64748b;
}

.db-badge.is-pending {
  background: #f1f3f5;
  color: #64748b;
}

.db-v-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.db-v-components {
  color: #536174;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.db-v-components.is-muted {
  color: #7a8796;
  font-size: 11.5px;
}

.db-replicon-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.db-replicon-field select {
  padding: 5px 30px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background-color: #ffffff;
  color: var(--ink);
  font-size: 13px;
  max-width: 380px;
}

.db-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
}

.db-preview-head select {
  padding: 7px 32px 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #ffffff;
  font-size: 13px;
}

.db-preview-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.db-preview-actions .button {
  font-size: 13px;
}

.db-curves {
  position: relative;
}

.db-chart {
  position: relative;
}

#database-canvas,
#database-ws-canvas,
#database-cpg-canvas {
  display: block;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
}

.db-chart-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(34, 139, 230, 0.55);
  pointer-events: none;
}

#database-canvas.panning,
#database-ws-canvas.panning,
#database-cpg-canvas.panning {
  cursor: grabbing;
}

.db-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  pointer-events: none;
  border-left: 1px solid rgba(34, 139, 230, 0.9);
  border-right: 1px solid rgba(34, 139, 230, 0.9);
  background: rgba(34, 139, 230, 0.12);
}

.db-selection-label {
  position: absolute;
  top: 7px;
  left: 50%;
  padding: 3px 7px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(10, 36, 99, 0.9);
  color: #ffffff;
  font-size: 11px;
  white-space: nowrap;
}

.db-chart-loading {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 36, 99, 0.85);
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.db-tooltip {
  position: absolute;
  z-index: 5;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  white-space: nowrap;
}

.db-tooltip b {
  font-weight: 600;
}

.db-tooltip .row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.db-tooltip .key {
  opacity: 0.8;
}

.db-view-hint {
  margin: 0 0 8px;
  color: var(--ink-muted);
  font-size: 12px;
}

#database-view-label {
  margin-left: 8px;
  color: var(--ink-soft);
}

#database-canvas {
  height: 360px;
}

#database-ws-canvas {
  height: 320px;
}

#database-cpg-canvas {
  height: 300px;
}

.db-figure-title {
  margin: 20px 0 8px;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
}

.db-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.db-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.db-legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 5px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.db-legend-toggle:hover {
  background: #f1f3f5;
}

.db-legend-toggle:focus-visible {
  outline: 2px solid #228be6;
  outline-offset: 2px;
}

.db-legend-toggle.is-hidden {
  color: #adb5bd;
}

.db-legend-toggle.is-hidden .swatch {
  opacity: 0.25;
}

.db-legend .swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.db-legend .swatch.ry {
  background: #228be6;
}

.db-legend .swatch.mk {
  background: #2f9e44;
}

.db-legend .swatch.at {
  background: #e8590c;
}

.db-legend .swatch.gc {
  background: #7950f2;
}

.db-legend .swatch.cds {
  background: #c2255c;
}

.db-legend .swatch.cpg {
  background: #0c8599;
}

.db-legend .swatch.ws {
  background: #fab005;
}

.db-legend .swatch.segment-gc {
  background: #0b7285;
}

.db-hint {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 12.5px;
}

/* where the data come from, and how to cite them */
.db-provenance {
  margin: 26px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fbfcfe;
}

.db-provenance .db-section-title {
  margin: 0 0 6px;
  text-align: left;
}

.db-provenance .db-section-title + .db-section-note {
  margin: 0 0 14px;
  text-align: left;
}

.db-citations {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.6;
}

.db-contact {
  margin: 18px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.db-contact a {
  color: #0a58ca;
  text-decoration: none;
}

.db-contact a:hover {
  text-decoration: underline;
}

.db-citations li {
  margin: 4px 0;
}

/* a column that sorts, and the size filter beside the others */
th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: var(--ink);
}

th.sortable.sorted {
  color: #0a2463;
}

th.sortable.sorted::after {
  content: ' ↑';
}

th.sortable.sorted[data-dir='desc']::after {
  content: ' ↓';
}

.db-size {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.db-size input {
  width: 66px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}


.db-citations a {
  display: block;
  margin-top: 2px;
  color: #0a58ca;
  font-size: 12px;
  text-decoration: none;
}

.db-citations a:hover {
  text-decoration: underline;
}

/* the islands stored for this molecule */
.db-islands {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fbfcfe;
}

#db-islands {
  margin-bottom: 22px;
}

#db-islands,
#db-cpg-islands {
  padding: 12px 14px;
}

.db-islands-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.db-islands-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #22324b;
}

.db-islands-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 3px 5px 3px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.db-islands-toggle:hover {
  background: #eef4fb;
}

.db-islands-toggle:focus-visible {
  outline: 2px solid #228be6;
  outline-offset: 2px;
}

.db-islands-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.db-islands-toggle[aria-expanded='true'] .db-islands-chevron {
  transform: rotate(45deg) translate(-1px, -1px);
}

.db-islands-note {
  flex: 1 1 220px;
  min-width: 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.db-islands-csv {
  flex: 0 0 auto;
  margin-left: auto;
}

.db-islands-body {
  margin-top: 12px;
  padding-top: 2px;
  border-top: 1px solid #edf1f5;
}

.db-islands-body[hidden] {
  display: none;
}

.db-islands-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
}

.db-islands-filter-title {
  color: #22324b;
  font-size: 12px;
  font-weight: 700;
}

.db-islands-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12px;
}

.db-islands-filter select,
.db-islands-filter input {
  height: 30px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background-color: #fff;
  color: var(--ink);
  font: inherit;
}

.db-islands-filter select {
  padding: 0 26px 0 8px;
}

.db-islands-filter input {
  width: 68px;
  padding: 0 7px;
  font-variant-numeric: tabular-nums;
}

.db-islands-filter select:focus,
.db-islands-filter input:focus {
  border-color: var(--accent, #228be6);
  outline: 2px solid color-mix(in srgb, var(--accent, #228be6) 18%, transparent);
  outline-offset: 1px;
}

.db-islands-filter-count {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 12px;
}

.db-islands-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

.db-islands-table th,
.db-islands-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}

.db-islands-table th {
  color: var(--ink-muted);
  font-weight: 600;
}

.db-islands-table td.host {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.db-islands-table td.num,
.db-islands-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.db-islands-more {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.db-islands-table td.kind {
  font-size: 11px;
  color: #55627a;
}

.db-islands-table td.kind.at {
  color: #2f9e44;
}

.db-islands-table td.kind.gc {
  color: #7950f2;
}

.db-islands-table td.kind.cpg {
  color: #0b7285;
}

@media (max-width: 680px) {
  .db-islands-filter-count {
    width: 100%;
    margin-left: 0;
  }
}
