/* ── Version compatibility chart ────────────────────────────────────────── */

.ub-vc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ub-vc-search {
  flex: 1 1 180px;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: transparent;
  color: var(--md-default-fg-color);
  font-family: 'Texturina', Georgia, serif;
  font-size: 0.8rem;
  line-height: 1.4;
}
.ub-vc-search:focus {
  outline: none;
  border-color: rgba(0, 240, 194, 0.45);
}
.ub-vc-search::-webkit-search-cancel-button { cursor: pointer; }

.ub-vc-btn {
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: transparent;
  color: var(--md-default-fg-color);
  font-family: 'Texturina', Georgia, serif;
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.ub-vc-btn:hover {
  border-color: rgba(0, 240, 194, 0.4);
  color: var(--teal-glow);
}
.ub-vc-clear { margin-left: auto; }

.ub-vc-count {
  font-size: 0.72rem;
  color: var(--muted-text);
  white-space: nowrap;
}

/* ── Single-table scroll container ──────────────────────────────────────── */

.ub-vc-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  background: var(--md-default-bg-color);
  isolation: isolate;
  overscroll-behavior: none;
}

.ub-vc-table {
  border-collapse: separate;
  border-spacing: 0 2px;
  width: max-content;
  min-width: 100%;
  background: var(--md-default-bg-color);
}

.ub-vc-table td,
.ub-vc-table th { border: none; }

/* ── Corner cell — sticky top + left ────────────────────────────────────── */

.ub-vc-table .ub-vc-lh {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  transform: translateZ(0);
  background: var(--md-default-bg-color);
  padding: 0.4rem 0.5rem;
  text-align: right;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--md-default-bg-color);
}

/* ── Version header cells — sticky top ──────────────────────────────────── */

.ub-vc-table thead th.ub-vc-vh {
  position: sticky;
  top: 0;
  z-index: 2;
  transform: translateZ(0);
  background: var(--md-default-bg-color);
  padding: 0.5rem 2px 0.25rem;
  text-align: center;
  vertical-align: bottom;
  box-shadow: 0 4px 0 var(--md-default-bg-color);
  min-width: 20px;
  width: 20px;
  cursor: pointer;
}
.ub-vc-table thead th.ub-vc-vh span {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  display: inline-block;
  white-space: nowrap;
  user-select: none;
  padding: 0;
}
.ub-vc-table thead th.ub-vc-vh code {
  font-size: 0.72rem;
  padding: 0.35em 0.1em;
  color: var(--md-default-fg-color);
}
.ub-vc-table thead th.ub-vc-vh:hover code { color: var(--teal-glow); }
.ub-vc-table thead th.ub-vc-vh.ub-vc-active code { color: var(--teal-glow); }
.ub-vc-table thead th.ub-vc-vh.ub-vc-active {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 0 var(--md-default-bg-color),
    inset 0 -2px 0 var(--teal-glow);
}

/* ── Label / name column — sticky left ──────────────────────────────────── */

.ub-vc-table td.ub-vc-lc {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--md-default-bg-color);
  padding: 0 0.3rem 0 0.2rem;
  text-align: right;
  width: 1px;
  white-space: nowrap;
}
.ub-vc-table td.ub-vc-lc a {
  font-family: 'Texturina', Georgia, serif;
  font-size: 0.78rem;
  color: var(--md-default-fg-color);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ub-vc-table td.ub-vc-lc a:hover { color: var(--teal-glow); }
.ub-vc-table td.ub-vc-lc a code {
  font-size: 0.72rem;
  padding: 0.1em 0.35em;
  color: var(--md-default-fg-color);
}
.ub-vc-table td.ub-vc-lc a:hover code {
  color: var(--teal-glow);
  background: rgba(0, 240, 194, 0.1);
}

/* ── Body rows ──────────────────────────────────────────────────────────── */

.ub-vc-table tbody tr {
  height: 10px;
  background: var(--md-default-bg-color);
}
.ub-vc-table tbody tr:hover td.ub-vc-lc a { color: var(--teal-glow); }

.ub-vc-table tbody td {
  padding: 0;
  height: 10px;
}

/* Bar fill */
.ub-vc-table tbody td.ub-vc-fill {
  background: rgba(0, 240, 194, 0.55);
}

/* Ghost name overlay — absolutely positioned inside the sticky label cell.
   Since the containing block is the sticky cell (not the scroll container),
   the overflow does NOT extend the scrollable width. */
.ub-vc-ghost-name {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  padding-left: 0.3em;
  font-family: 'Texturina', Georgia, serif;
  font-size: 0.6rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  max-width: var(--ub-vc-bar-w, 9999px);
  overflow: hidden;
}
.ub-vc-table tbody tr:hover .ub-vc-ghost-name {
  color: rgba(0, 240, 194, 0.18);
}

/* Loading / error */
.ub-vc-loading,
.ub-vc-error {
  color: var(--muted-text);
  font-style: italic;
  font-size: 0.85rem;
  padding: 1rem 0;
}