/** BASICS
--------------------------------------------------------- */

.row-from-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.row-from-right > * {
  margin-left: 8px;
}



/** HEADINGS AND PARAGRAPHS
--------------------------------------------------------- */

h1 {
  font-size: 2.6rem;
  font-weight: 300;
}

h2 {
  font-size: 1.2rem;
  font-weight: 300;
}

h3 {
  font-size: 1rem;
  font-weight: 400;
  margin: 1rem 0;
}

small {
  font-size: .5em;
}

p {
  color: rgba(255, 255, 255, .5);
  line-height: 1.5;
  word-break: break-word;
}



/** ARTICLES
--------------------------------------------------------- */

article + article {
  margin-top: 16px;
}

article.large > :nth-child(n+2) {
  margin-top: 1rem;
}

article section li {
  color: rgba(255, 255, 255, .5);
}

article ul li::before {
  content: '\b7';
  margin-right: 8px;
}

article .article-ruler {
  padding-left: 2rem;
  border-left: 1px solid rgba(255, 255, 255, .05);
}

article section {
  position: relative;
}

article section:target {
  background: #e5323255;
  padding: 2em;
}

article section.article-ruler:target {
  border-left: none;
}

article .nav-link,
article .exit-nav-link {
  padding: 1px;
  font-size: 1rem;
  font-weight: 400;
  width: 1em;
  height: 1em;
  border-radius: 2px;
  background: rgba(255, 255, 255, .05);
  text-align: center;
  display: inline-block;
  margin-left: .5em;
}

article .table-of-content {
  border: 1px dashed rgba(255, 255, 255, .05);
  border-width: 1px 0;
  padding: 1rem;
  list-style: none;
  counter-reset: ol;
}

article .table-of-content a {
  display: flex;
  padding: .25em 0;
}

article .table-of-content a::before {
  counter-increment: ol;
  content: counter(ol)'.';
  margin-right: .5em;
}



/** TOOLTIPS
--------------------------------------------------------- */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .9);
  color: #111;
  color: var(--bg-color);
  border-radius: 2px;
  padding: 4px 8px;
  pointer-events: none;
  bottom: 100%;
  margin: auto;
  white-space: nowrap;
  transform: translateX(-50%);
  left: 50%;
  z-index: 4;
}

[data-tooltip]::after {
  position: absolute;
  content: '';
  bottom: calc(100% - 6px);
  border-radius: 50%;
  transform: translateX(-50%);
  left: 50%;
  height: 4px;
  width: 4px;
  background: white;
  z-index: 4;
}

[data-tooltip]:hover::before, [data-tooltip]:hover::after {
  transition: opacity .1s .15s;
}

[data-tooltip]:not(:hover)::before, [data-tooltip]:not(:hover)::after {
  opacity: 0;
  transition: opacity .2s;
}



/** ANIMATIONS
--------------------------------------------------------- */

@keyframes pulse {
  50% {
    color: white;
    fill: white;
  }
}

@keyframes pulseWeak {
  50% {
    color: rgba(255, 255, 255, .8);
    fill: rgba(255, 255, 255, .8);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg) }
  100% { transform: rotate(360deg) }
}

@keyframes flash {
  0% {
    box-shadow: 0 0 4px 4px rgba(255, 255, 255, .075);
  }
}

@keyframes flashAccent {
  0% {
    box-shadow: 0 0 4px 4px #e53232;
    box-shadow: 0 0 4px 4px var(--accent-color);
  }
}



/** LINKS
--------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: none;
  outline: none;
  transition: color .15s;
}

a:hover {
  animation: pulse .38s infinite;
}

a:active, a:focus {
  color: white;
}

p a {
  text-decoration: underline;
  color: rgba(255, 255, 255, .6);
}

p a:hover, p a:focus {
  animation: pulseWeak .38s infinite;
}

p a:active {
  color: rgba(255, 255, 255, .8);
}



/** ICONS
--------------------------------------------------------- */

.icon {
  width: 1em;
  height: 1em;
  fill: rgba(255, 255, 255, .8);
}

.icon.half-width {
  width: .5em;
}



/** FORM ELEMENTS
--------------------------------------------------------- */

form > :not(:first-child):not(:last-child) {
  margin: 8px 0;
}

form .actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

form .actions > * {
  margin-left: 1em;
}

input:not([type="checkbox"]), textarea {
  font: inherit;
  line-height: 1.5;
  color: inherit;
  border: none;
  display: block;
  background: rgba(255, 255, 255, .05);
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px;
  border-radius: 2px;
  resize: none;
}

/** WEBKIT FIX */
input[type="search"] {
  -webkit-appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}
/** END WEBKIT FIX */

input[readonly] {
  background: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}

input:focus, textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, .075);
  animation: flash .6s;
}

input:invalid {
  color: rgba(255, 255, 255, .5);
}

input::-webkit-input-placeholder { color: rgba(255, 255, 255, .2); }
input:-ms-input-placeholder { color: rgba(255, 255, 255, .2); }
input::-moz-placeholder {
  color: rgba(255, 255, 255, .2);
  opacity: 1;
}

label {
  cursor: pointer;
}

input[type="checkbox"]:hover + label, input[type="checkbox"] + label:hover,
input[type="checkbox"]:focus + label, input[type="checkbox"] + label:focus,
input[type="checkbox"]:active + label, input[type="checkbox"] + label:active {
  animation: pulse .38s infinite;
}

input[type="checkbox"] + label {
  display: flex;
  align-items: center;
}

input[type="checkbox"] + label::before {
  margin-right: 16px;
  flex: none;
  content: '';
  display: block;
  border-radius: 2px;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, .05) url(/public/vectors/checkbox/uncheck.svg);
  transition: transform .1s;
}

input[type="checkbox"]:checked + label::before {
  background-image: url(/public/vectors/checkbox/check.svg);
}

input[type="checkbox"]:disabled + label::before {
  background-image: url(/public/vectors/checkbox/disable.svg);
}

input[type="checkbox"]:hover + label::before {
  transform: scale(1.25);
}

.input-group {
  position: relative;
  background: rgba(255, 255, 255, .05);
  border-radius: 2px;
  overflow: hidden;
}

.input-group label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
}

.input-group > label {
  padding: 8px 16px 0;
  cursor: text;
}

.input-group input, .input-group textarea {
  background: none;
  border-radius: 0;
}

.input-group .related-tick {
  position: absolute;
  top: 8px;
  right: 8px;
}

.input-group .related-tick label::before {
  order: 1;
  margin-right: 0;
  margin-left: 8px;
}

tick-input,
.tick-input {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 1em;
  transition: background .6s;
}

tick-input[disabled] {
  pointer-events: none;
}

tick-input:active,
.tick-input:active {
  background: rgba(255, 255, 255, .05);
  transition: background 0s;
}

tick-input svg,
.tick-input svg {
  flex: none;
  background: rgba(255, 255, 255, .05);
  border-radius:  2px;
  overflow: hidden;
  margin-right: 8px;
  transition:
    fill .1s,
    background .6s;
}

tick-input:active svg,
.tick-input:active svg {
  background: rgba(255, 255, 255, .1);
  transition:
    fill .1s,
    background 0s;
}

tick-input .label,
.tick-input .label {
  transition: color .1s;
}

tick-input:not([checked]) svg,
tick-input[disabled] svg.icon,
.tick-input input:not(:checked) ~ svg {
  fill: rgba(255, 255, 255, .2);
}

tick-input[disabled] .label,
.tick-input input:disabled ~ .label {
  color: rgba(255, 255, 255, .2);
}

tick-input:hover,
.tick-input:hover {
  color: white;
}

.tick-input .label span {
  display: block;
  font-size: .75em;
}



/** BUTTONS
--------------------------------------------------------- */

button,
[role="button"] {
  padding: .25em 1em;
  line-height: 1.5;
  min-height: 2em;
  overflow: hidden;
  font: inherit;
  color: inherit;
  fill: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .05);
  background: var(--color-el-background);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition:
    background .6s,
    color .15s,
    fill .15s;
}

button > :nth-child(n+2),
[role="button"] > :nth-child(n+2) {
  margin-left: .5em;
}

button > svg ,
[role="button"] > svg {
  flex: none;
}

button > span,
[role="button"] > span {
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

button.active-item,
[role="button"].active-item {
  color: rgba(255, 255, 255, .2);
  fill: rgba(255, 255, 255, .2);
}

button:hover,
[role="button"]:hover {
  color: white;
}

button:focus,
[role="button"]:focus {
  outline: none;
}

button:active,
button:focus,
[role="button"]:active,
[role="button"]:focus {
  color: white;
  fill: white;
}

button:active, [role="button"]:active {
  transition: none;
  background: rgba(255, 255, 255, .1);
}

button.strong, [role="button"].strong {
  background: rgba(255, 255, 255, .1);
}

button.strong:active, [role="button"].strong:active {
  background: rgba(255, 255, 255, .2);
}

button:disabled,  input[type="checkbox"]:disabled + label {
  color: rgba(255, 255, 255, .2);
  fill: rgba(255, 255, 255, .2);
  pointer-events: none;
  animation: none;
}



/** LISTS
--------------------------------------------------------- */

ul {
  list-style: none;
}

nav ul.interactive,
ul.data-list {
  border-top: 1px solid rgba(255, 255, 255, .05);
}

ul.interactive li,
ul.data-list li {
  display: flex;
  align-items: stretch;
  background-clip: padding-box;
  transition: background .6s;
  /* margin: 0 -16px; */
}

ul.interactive li {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

nav ul.interactive li,
ul.data-list li {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

ul.interactive li:active {
  transition: none;
  background-color: rgba(255, 255, 255, .05);
}

ul.interactive li > * {
  display: flex;
  align-items: center;
  padding: 1em;
  flex: auto;
}

ul.data-list li > * {
  display: flex;
  align-items: center;
  padding: .5em;
  line-height: 1;
  flex: auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

ul.data-list li > :nth-child(n+2) {
  border-left: 1px solid rgba(255, 255, 255, .05);
}

li > .fixed {
  flex: none !important;
}

li > .kloss {
  align-self: stretch;
  width: 4em;
  flex: none !important;
  background-color: rgba(255, 255, 255, .02);
}

li > .kloss > :nth-child(n+2) {
  margin-left: .5em;
  margin-left: var(--space-inline);
}



/** SLIDERS
--------------------------------------------------------- */

.slider {
  position: relative;
  background: rgba(255, 255, 255, .2);
  height: 2px;
}

.slider > div {
  position: relative;
  height: 100%;
  max-width: 100%;
  background: #e53232;
  background: var(--accent-color);
}

.slider:not(.dragging) .handle {
  transition: width .15s;
}

.slider .handle::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  background: rgba(255, 255, 255, .2);
  border-radius: 50%;
  right: -8px;
  top: -7px;
  transition: background .15s;
}

.slider:active .handle::before {
  background: rgba(255, 255, 255, .3);
  transition: none;
}

.slider .handle::after {
  content: '';
  position: absolute;
  height: 4px;
  width: 4px;
  background: white;
  border-radius: 50%;
  right: -2px;
  top: -1px;
}



/** Tables
--------------------------------------------------------- */
table {
  border-collapse: collapse;
}

table td {
  border: 1px solid rgba(255, 255, 255, .025);
  padding: .5em;
}


/** ALERTS
--------------------------------------------------------- */

pre {
  border: 1px dotted rgba(255, 255, 255, 0.05);
  font: 500 .75em/1 'Source Code Pro', monospace;
  overflow: auto;
  border-radius: .25rem;
  padding: 16px;
  color: #e53232;
  color: var(--accent-color);
}

.alert {
  margin: 8px 0;
  padding: 4px 16px;
  border-radius: 2px;
  background: #e53232;
  background var(--accent-color);
  overflow: hidden;
  display: flex;
  flex: none;
  align-items: center;
  cursor: pointer;
}

.alert > :nth-last-child(n+2) {
  margin-right: 1em;
}

.alert svg {
  margin-left: auto;
  border-radius: 50%;
  transition: background .1s;
}

.alert:hover svg {
  background: rgba(255, 255, 255, .8);
}

.alert button {
  transform: translateX(12px);
}


/** DIALOGS
--------------------------------------------------------- */
.dialog-wrapper {
  z-index: 100;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  background: rgba(0, 0, 0, .8);
  display: flex;
  justify-content: center;
  align-items: center;
}

.dialog {
  max-width: 100vw;
  max-height: 100vh;
  flex: none;
  padding: var(--space-block);
  background: var(--color-background);
  border-radius: 2px;
}

.dialog .dialog-window-bar {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-block);
}

.dialog .dialog-window-bar .close {
  margin-left: auto;
}