/* Toggle switch (table/JSON), shown inline in an expanded phantom card */
.view-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.view-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 10px;
}
.view-toggle-btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.view-toggle-track {
  display: block;
  width: 28px;
  height: 16px;
  background: var(--c-base);
  border-radius: 8px;
  position: relative;
  transition: background 0.15s;
}

.view-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--c-text);
  border-radius: 50%;
  box-shadow: 0 1px 2px var(--c-shadow);
  transition: transform 0.15s;
}

.view-toggle-btn[aria-checked="true"] .view-toggle-track { background: var(--c-accent); }
.view-toggle-btn[aria-checked="true"] .view-toggle-thumb { transform: translateX(12px); }

.view-toggle-label {
  font-size: 0.74rem;
  color: var(--c-text);
  min-width: 3.5ch;
}

/* JSON viewer */
.json-viewer {
  margin: 0;
  padding: 1rem 1.1rem;
  font-size: 0.81rem;
  line-height: 1.65;
  white-space: pre;
  color: var(--c-surface);
  tab-size: 2;
}

.json-key  { color: var(--c-accent); }
.json-str  { color: var(--c-dim); }
.json-num  { color: var(--c-text); }
.json-bool { color: var(--c-text); }

/* Tissue table */
.table-wrap {
  overflow-x: auto;
  scrollbar-color: var(--c-surface) var(--c-base);
  border-radius: var(--radius);
  background: var(--c-base);
}

.tissue-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

.tissue-table th,
.tissue-table td {
  text-align: left;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--c-surface);
  white-space: nowrap;
  vertical-align: top;
}

.tissue-table thead th {
  background: var(--c-base);
  font-weight: 600;
  color: var(--c-accent);
  position: sticky;
  top: 0;
}

.cell-missing { color: var(--c-dim); }

.cell-ref {
  cursor: help;
  position: relative;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.cell-ref[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-text);
  color: var(--c-base);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.tissue-table tbody th { font-weight: 600; background: var(--c-base); color: var(--c-dim); }

.tissue-table code {
  font-size: 0.82rem;
  background: var(--c-surface);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}
