* {
  /* include padding and border in total width/height calculations by default */
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  font-family: "Be Vietnam Pro", Avenir, Helvetica, Arial, sans-serif;
}

/* GLOBAL VARIABLES */
html[data-theme="light"] {
  --cr-text-primary: rgb(17, 15, 13);
  --cr-text-contrast: rgb(255, 255, 255);
  --cr-bg-primary: rgb(255, 255, 255);
  --cr-bg-secondary: rgb(246, 248, 250);
  --cr-bg-contrast: rgb(212, 212, 212);
  --cr-primary: rgb(60, 140, 219);
  --cr-secondary: rgb(156, 147, 235);
  --cr-accent: rgb(141, 100, 226);
  --br-radius-small: 0.3rem;
  --cr-warning: rgb(255, 0, 0);
  --cr-caution: rgb(255, 165, 0);
  --cr-border-primary: rgb(208 215 222 / 70%);
  --cr-border-secondary: rgba(175, 184, 193, 0.20);
}

html[data-theme="dark"] {
  --cr-text-primary: rgb(255, 255, 255);
  --cr-text-contrast: rgb(17, 15, 13);
  --cr-bg-primary: rgb(13, 17, 23);
  --cr-bg-secondary: rgb(22, 27, 34);
  --cr-bg-contrast: rgb(119, 119, 119);
  --cr-primary: rgb(60, 140, 219);
  --cr-secondary: rgb(156, 147, 235);
  --cr-accent: rgb(141, 100, 226);
  --br-radius-small: 0.25rem;
  --cr-warning: rgb(255, 0, 0);
  --cr-caution: rgb(255, 165, 0);
  --cr-border-primary: rgb(48, 54, 61);
  --cr-border-secondary: rgba(175, 184, 193, 0.20);
}

:root {
  color: var(--cr-text-primary);
  background-color: var(--cr-bg-primary);
  transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
  --nav-height: 3rem;
}

*::-webkit-scrollbar {
width: 16px;
height: 16px
}

.invisible-scrollbar::-webkit-scrollbar {
display: none
}

*::-webkit-scrollbar-track {
background-color: var(--cr-bg-primary)
}

*::-webkit-scrollbar-thumb, *::-webkit-scrollbar-track {
border: 4px solid transparent;
background-clip: padding-box;
border-radius: 8px
}

*::-webkit-scrollbar-thumb {
background-color: var(--cr-bg-contrast);
min-height: 40px
}

*::-webkit-scrollbar-corner {
background-color: transparent
}


button {
  padding: 0.5rem 1rem;
  display: inline-block;
  appearance: none;
  user-select: none;
  background-color: var(--cr-bg-secondary);
  color: var(--cr-text-primary);
  border: 1px solid var(--cr-border-primary);
  border-radius: var(--br-radius-small);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

button:not(:disabled):hover {
  background-color: var(--cr-primary);
  border-color: var(--cr-primary);
  color: var(--cr-text-contrast);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body {
  margin: 0;
  display: flex;
  position: relative;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100lvh;
  width: 100vw;
  overflow-x: hidden;
  font-family: var(--font-vietnam);
}

nav {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: var(--nav-height);
}

nav a {
  text-decoration: none;
  color: var(--cr-text-primary);
}

nav ul {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  list-style: none;
  user-select: none;
}

nav li.nav-link {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-width: 6rem;
  padding: 0 1rem;
}

nav li.nav-link:hover {
  background-color: var(--cr-bg-secondary);
}

nav li.right-align {
  margin-left: auto;
  min-width: 0;
  padding-right: 1rem;
  gap: 2rem;
}

@media (width < 600px) {
  nav > ul:first-of-type {
    display: none;
  }
  nav > ul {
    width: unset;
  }
  nav li.right-align {
    margin-left: 0;
    padding: 0;
  }
  nav {
    justify-content: center;
  }
}

svg {
  user-select: none;
  touch-action: none;
  pointer-events: none;
}

button.svg-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

button.svg-button:hover {
  background-color: transparent;
  color: var(--cr-accent);
}

button.svg-button > svg {
  width: 1.75rem;
  height: 1.75rem;
}

form {
  display: flex;
  flex-direction: column;
  user-select: none;
  gap: 0;
}

form > .input-group {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;

  min-height: 4rem;
  border-top: 1px solid var(--cr-border-primary);
  padding: 1rem 0;
}

.input-group--disabled *:not(input[type="checkbox"]) {
  opacity: 0.5;
}

form > .input-group:last-of-type {
  border-bottom: 1px solid var(--cr-border-primary);
  margin-bottom: 1rem;
}

form > .input-group output {
  display: inline-block;
}
.input-group-half:first-child {
  width: 40%;
}
.input-group-half {
  gap: 0.5rem;
  width: 60%;
}

.input-group-half.right-align {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.range-labels {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.25rem;
  width: 6rem;
}

.range-group {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.annotated-input {
  display: flex;
  flex: 1;
  width: 50%;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.input-group-half.space-align {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-group-half.space-align input[type="number"] {
  width: 100%;
}

.input-group input[type="number"].small {
  width: 5.5rem;
}

select, input[type="number"], input[type="text"], textarea {
  padding: 0.5rem;
  border: 2px solid var(--cr-border-primary);
  border-radius: var(--br-radius-small);
  background-color: var(--cr-bg-primary);
  color: var(--cr-text-primary);
  font-size: 1rem;
  transition: all 0.20s ease-in-out;
}

select:focus, input[type="number"]:focus {
  background-color: var(--cr-bg-secondary);
}

input[type="number"] {
  width: 50%;
}

input[type="range"] {
  width: 100%;
}

input[type="checkbox"] {
  position: relative;
  overflow: hidden;
  appearance: none;
  height: 2rem;
  width: 3.5rem;
  border-radius: 50px;
  outline: none;
  border: none;
  background-color: var(--cr-bg-contrast);
  transition: all ease-in-out 0.2s;
}

input[type="checkbox"]:checked {
  background-color: var(--cr-primary);
}

input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background-color: rgb(255, 255, 255);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: all cubic-bezier(0.3, 1.5, 0.7, 1) 0.3s;
  z-index: 2;
}

input[type="checkbox"]:checked::before {
  transform: translateX(1.5rem);
}

input[type="checkbox"]:disabled {
  background-color: #D1D1D6;
}

input[type="checkbox"]:disabled::before {
  background-color: #8E8E93;
}

select:disabled {
  cursor: not-allowed;
}

textarea {
  width: 100%;
  transition: none;
  max-width: 100%;
  min-width: 100%;
}

em {
  font-style: italic;
  color: var(--cr-warning);
}

fieldset.radio-group {
  border: none;
  font-size: 1rem;

}

fieldset.radio-group ul {
  list-style: none;
  display: flex;
  position: relative;
  flex-direction: row;
  gap: 0.5rem;
}

fieldset.radio-group input[type="radio"] {
  opacity: 0;
  position: absolute;
  background-color: var(--bg-contrast);
}

fieldset.radio-group input[type="radio"]:checked + label {
  background-color: var(--cr-primary);
  color: var(--cr-text-contrast);
}

fieldset.radio-group label {
  padding: 0.5rem 0.75rem;
  display: inline-block;
  color: var(--cr-text-primary);
  background-color: var(--cr-bg-primary);
  border: 1px solid var(--cr-border-primary);
  border-radius: var(--br-radius-small);
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

main.card-container {
  display: flex;
  flex-direction: row;
  flex: 1;
  padding: 0.5rem;
  padding-top: 0rem;
  gap: 0rem;
  background-color: var(--cr-bg-primary);
  width: 100%;
  max-height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.card-panel {
  position: relative;
}

@media (width >= 1200px) {
  main.card-container > .card-panel--side {
    flex-grow: 1;
    width: 40%;
  }
  main.card-container > .card-panel--main {
    flex-grow: 3;
    width: 60%;
  }
}


@media (width < 1200px) {
  div.card-separator {
    pointer-events: none;
  }
  div.card-separator::before {
    content: " ";
    height: 0.5rem;
  }
  div.card-separator::after {
    display: none;
  }
  main.card-container {
    flex-direction: column;
    max-height: auto;
  }
}

@media (width < 600px) {
  main.card-container {
    padding: 0;
  }
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100%;
  background-color: var(--cr-bg-primary);
  border-radius: var(--br-radius-small);
  border: 1px solid var(--cr-border-primary);
}

.card > .card-content {
  padding: 2rem;
  height: 100%;
  max-width: 100%;
  overflow-y: auto;
}

@media (width >= 1200px) {
  .card > .card-content {
    min-width: 525px;
  }
}

.card-content > h2 {
  margin-bottom: 1rem;
}

.card-separator {
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  cursor: ew-resize;
  width: 0.5rem;
  user-select: none;
}
.card-separator::after {
  content: " ";
  display: block;
  width: 0.15rem;
  height: 2rem;
  background-color: var(--cr-bg-contrast);
  border: 1px solid var(--cr-border-primary);
  cursor: ew-resize;
  border-radius: var(--br-radius-small);
}

#mutation-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  user-select: none;
}

#mutation-list pre {
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

button.icon-button {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  gap: 0.5rem;
}

button.icon-button svg {
  vertical-align: middle;
  fill: currentColor;
  height: 1.5rem;
  width: 1.25rem;
}

.dropdown-button {
  position: relative;
}

.dropdown-button > .dropdown-content {
  opacity: 0;
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 0;
  background-color: var(--cr-bg-primary);
  border: 1px solid var(--cr-border-primary);
  border-radius: var(--br-radius-small);
  padding: 0rem;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.15s ease-in-out;
}

.dropdown-button > .dropdown-content.show {
  pointer-events: auto;
  opacity: 1;
}

.dropdown-content button {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: var(--cr-bg-primary);
  border: none;
  border-radius: var(--br-radius-small);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-wrap: nowrap;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.launch-svg {
  color: var(--cr-text-primary);
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
}

button:hover .launch-svg {
  color: var(--cr-text-contrast);
}

/* https://observablehq.com/@mootari/css-tree
   Released under the ISC License */
ul.tree-root {
  --branch-width: 2ch;
  --branch-border: 1px solid currentColor;
  --branch-offset: 2.5ch;
  --branch-vertical-border: 1px solid currentColor;
  --branch-radius: 1ch;
  --item-width: 200px;
  margin: 0;
  padding: 0;
  list-style: none;
  padding-left: var(--branch-width);
  max-width: none;
}

li.tree-item {
  padding: 0;
  padding-left: var(--branch-width);
  position: relative;
  margin: 0;
  user-select: none;
}

li.tree-item > .tree-item-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 0.25rem 0.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  border-radius: 0.25rem;
  width: var(--item-width);
  background-color: var(--cr-bg-primary);
  color: var(--cr-text-primary);
  border: 1px solid var(--cr-border-primary);
}

li.tree-item::before,
li.tree-item::after {
  content: "";
  position: absolute;
  box-sizing: content-box;
  left: 0;
  top: 0;
}

li.tree-item:not(:last-child)::before {
  height: 100%;
  border-right: var(--branch-vertical-border);
}
li.tree-item::after {
  width: var(--branch-width);
  height: var(--branch-offset);
  border-left: var(--branch-vertical-border);
  border-bottom: var(--branch-border);
  border-bottom-left-radius: var(--branch-radius);
}

li.tree-item {
  display: flex;
  align-items: flex-start;
}

li.tree-item:first-child:not(:last-child)::before {
  width: var(--branch-width);
  height: calc(100% - var(--branch-offset));
  left: calc(-1 * var(--branch-width));
  top: var(--branch-offset);
  border-top: var(--branch-border);
  border-top-right-radius: var(--branch-radius);
}

li.tree-item:first-child::after {
  width: calc(2 * var(--branch-width));
  left: calc(-1 * var(--branch-width));
  border-left: none;
  border-bottom-left-radius: 0;
}

/* end of css-tree */

#mutation-content {
  overflow-x: auto;
  display: flex;
  height: 100%;
}

@media (width < 1200px) {
  #mutation-content {
    max-height: 90vh;
  }
}

#mutation-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  cursor: grab
}

#mutation-tree > .tree-root > .tree-item:first-child::before {
  border-radius: 50%;
  left: calc(-1 * var(--branch-width));
  top: calc(var(--branch-offset) - (0.5rem / 2));
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--cr-text-primary);
}

#no-data-message {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  font-size: 2.5rem;
  font-weight: 600;
  opacity: 50%;
  user-select: none;
}

div.merged-button-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
}
