:root {
  --swatch-border-color: hsl(0, 0%, 90%);
  --swatch-bg-color: white;
  --swatch-bg-alt-color: hsl(0, 0%, 87%);
  --swatch-gamut-border-color: hsl(340 82% 52%);
  --swatch-stops: transparent, transparent;
}

:root [data-md-color-scheme="slate"] {
  --swatch-border-color: hsla(232, 15%, 25%, 1);
}

:root [data-md-color-scheme="dracula"] {
  --swatch-border-color: hsl(233, 15%, 33%, 1);
  --swatch-gamut-border-color: hsl(326, 100%, 74%);
}

.swatch {
  vertical-align: text-bottom;
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  margin-left: 0.25em;
  margin-right: 0.2em;
  border-radius: 100px;
  line-height: 0;
  transition: all 0.5s ease;
  background-color: var(--swatch-bg-color);
  background-image: linear-gradient(45deg, var(--swatch-bg-alt-color) 25%, transparent 25%),
                    linear-gradient(-45deg, var(--swatch-bg-alt-color) 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, var(--swatch-bg-alt-color) 75%),
                    linear-gradient(-45deg, transparent 75%, var(--swatch-bg-alt-color) 75%);
  background-size: 0.5em 0.5em;
  background-position: 0 0, 0 0.25em, 0.25em -0.25em, -0.25em 0px;
  box-shadow: 0.1em 0.1em 0.1em rgba(0, 0, 0, .3);
}

div.swatch-bar .swatch {
  background-size: 1em 1em;
  background-position: 0 0, 0 0.50em, 0.50em -0.50em, -0.50em 0px;
  box-shadow: none;
}

.swatch-color {
  vertical-align: text-bottom;
  display: inline-block;
  box-sizing: border-box;
  border-radius: 100px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--swatch-border-color);
  height: 1.25em;
  width: 1.25em;
  background: linear-gradient(to right, var(--swatch-stops));
}

.swatch-gradient,
.swatch-gradient .swatch-color {
  width: 10em;
}

.swatch-gradient,
.swatch-gradient .swatch-color {
  border-radius: 0;
  width: 100%;
  height: 3em;
  margin: 0;
}

div.swatch-bar .swatch:not(.swatch-gradient),
div.swatch-bar .swatch:not(.swatch-gradient) .swatch-color {
  border-radius: 0;
  height: 3em;
  width: 3em;
  margin: 0;
}

div.swatch-bar {
  box-sizing: border-box;
  border: 2px solid var(--md-code-bg-color);
  background-color: var(--md-default-bg-color);
  background-image: linear-gradient(45deg, var(--md-code-bg-color) 25%, transparent 25%),
                    linear-gradient(-45deg, var(--md-code-bg-color) 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, var(--md-code-bg-color) 75%),
                    linear-gradient(-45deg, transparent 75%, var(--md-code-bg-color) 75%);
  background-size: 1em 1em;
  background-position: 0 0, 0 0.50em, 0.50em -0.50em, -0.50em 0px;
}

.swatch.out-of-gamut .swatch-color {
  border-color: var(--swatch-gamut-border-color);
}

.swatch:hover {
  z-index: 2;
  transform: scale(2);
}

div.swatch-bar > .swatch:hover {
  z-index: 2;
  transform: scale(1.2) translateY(-0.2em);
}

div.swatch-bar > .swatch-gradient:hover {
  z-index: 2;
  transform: scale(1.02, 1.2) translateY(-0.2em);
}

div.color-command {
  margin: 1em 0;
  line-height: 0;
}

div.color-command .highlight:not(:first-child) pre {
  margin-top: 0;
}

div.color-command .highlight:not(:first-child) {
  border-top: 1px solid var(--md-default-fg-color--lightest);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset > div.color-command {
    margin-left: -0.8rem;
    margin-right:  -0.8rem;
  }

  .md-typeset > div.color-command .highlight code {
    border-radius: 0;
  }
}


.playground-inputs {
  -webkit-appearance: textarea;
  position: absolute;
  margin: 0;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  min-height: 3em;
  height: calc(100% + 0.2rem);
  border: none;
  padding: .7720588235em 1.1764705882em;
  outline: none;
  cursor: text;
  overflow-x: auto;
  overflow-y: hidden;
  caret-color: var(--md-code-fg-color);
  color: transparent;
  background-color: transparent;
  font-feature-settings: "kern";
  font-family: var(--md-code-font-family,_),SFMono-Regular,Consolas,Menlo,monospace;
  line-height: 1.4;
  font-size: .85em;
  z-index: 1;
  resize: none;
  word-wrap: unset;
  white-space: pre;
}

.playground-inputs::selection {
  color: var(--md-code-bg-color);
  background: var(--md-code-fg-color);
  font-weight: bold;
}

.playground-code {
  margin-top: 2px;
  width: 100%;
  height: 100%;
  position: relative;
  overlow: hidden;
}

.playground-code .highlight code {
  min-height: 3em;
}

.playground-code .highlight,
.playground-code .highlight code {
  margin: 0;
  overflow: hidden;
}

.playground-code pre {
  margin: 0;
  pointer-events: none;
  height: calc(100% + 0.2rem);
}

.playground-results code {
  min-height: 3em;
}

.playground-results pre {
  margin-bottom: 0;
}

.playground-results .swatch-bar {
  min-height: calc(3em + 4px);
}

.playground-results .swatch-bar:empty {
  display: none;
}

.playground-results .swatch-bar:empty + .highlight {
  border-color: transparent;
}

.playground-results .color-command {
  margin-bottom: 0;
}

.hidden .highlight,
.hidden .playground-inputs,
button.hidden {
  display: none;
}

button:not(.md-clipboard) {
  font-size: 90%;
  margin-top: 0.25em;
  padding: 0.25em 1em;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  border-radius: .1rem;
}

button:not(.md-clipboard):hover {
  cursor: pointer;
}

button[disabled] {
  opacity: 0.5;
}

/* Enabling custom scroll bar causes issues with Safari.
   Safari renders `textarea` content in a shadow DOM, and
   the content is smaller than the text area with scrollbar.
   This can cause the overlay text to not be aligned with the
   underlying code highlighted content. */
/*.md-typeset textarea::-webkit-scrollbar {
  width: 0.2rem;
  height: 0.2rem;
}

.md-typeset textarea::-webkit-scrollbar-corner {
  background-color: transparent;
}

.md-typeset textarea::-webkit-scrollbar-thumb {
  background-color: var(--md-default-fg-color--lighter);
}

.md-typeset textarea::-webkit-scrollbar-thumb:hover {
  background-color: var(--md-accent-fg-color);
}

.md-typeset textarea {
  scrollbar-color: var(--md-default-fg-color--lighter) transparent;
  scrollbar-width: thin;
}

.md-typeset textarea:hover {
  scrollbar-color: var(--md-accent-fg-color) transparent;
}*/
