[data-desktop-only] {
  @media (max-width: 768px) {
    display: none;
  }
}

[data-mobile-only] {
  @media (min-width: 769px) {
    display: none;
  }
}

* {
  box-sizing: inherit;
}

html {
  --box-sizing: border-box;

  --font-smoothing: antialiased;
  --moz-font-smoothing: grayscale;
  --text-size-adjust: 100%;

  --font-family: Avenir, sans-serif;
  --monospace-font-family: Menlo, monospace;

  --color-rgb: 8, 10, 60;
  --background-color-rgb: 239, 239, 239;
  --panel-background-color-rgb: 255, 255, 255;
  --accent-color-rgb: 17, 136, 105;
  --shadow-color-rgb: var(--color-rgb);
  --focus-color-rgb: var(--accent-color-rgb);
  --primary-background-color-rgb: var(--accent-color-rgb);
  --input-background-color-rgb: var(--background-color-rgb);
  --dialog-background-color-rgb: var(--background-color-rgb);
  --backdrop-background-color-rgb: var(--panel-background-color-rgb);

  --color: rgb(var(--color-rgb));
  --background-color: rgb(var(--background-color-rgb));
  --panel-background-color: rgb(var(--panel-background-color-rgb));
  --accent-color: rgb(var(--accent-color-rgb));
  --shadow-color: var(--shadow-color-rgb);
  --focus-color: rgba(var(--focus-color-rgb), .4);
  --primary-background-color: rgb(var(--primary-background-color-rgb));
  --input-background-color: rgb(var(--input-background-color-rgb));
  --dialog-background-color: rgb(var(--dialog-background-color-rgb));
  --backdrop-background-color: rgb(var(--backdrop-background-color-rgb));

  --selection-color: var(--background-color);
  --selection-background-color: var(--accent-color);

  --font-size: 18px;
  --line-height: 1.5;
  --focus-size: .1875em;
  --border-radius: .25em;
  --line-width: .0625em;
}

html[data-theme="dark"] {
  --color-rgb: 210, 210, 210;
  --accent-color-rgb: 60, 232, 180;
  --background-color-rgb: 33, 33, 33;
  --panel-background-color-rgb: 45, 45, 45;
  --input-background-color-rgb: 27, 27, 27;
  --shadow-color-rgb: 0, 0, 0;
  --dialog-background-color-rgb: var(--panel-background-color-rgb);
  --backdrop-background-color-rgb: var(--background-color-rgb);
}

html {
  box-sizing: var(--box-sizing);

  -webkit-text-size-adjust: var(--text-size-adjust);
  text-size-adjust: var(--text-size-adjust);

  font-family: var(--font-family);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--color);
  background-color: var(--background-color);
}

[with-selection-styled] ::selection {
  color: var(--selection-color);
  background: var(--selection-background-color);
}

@media (prefers-reduced-motion: no-preference) {
  [is-smooth-scrolling] {
    scroll-behavior: smooth
  }
}

.Link {
  box-sizing: border-box;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  --underline-size: .1em;
  --underline-color: var(--accent-color);
  --underline-shadow: inset 0 calc(-1 * var(--underline-size)) var(--underline-color);
  --focus-size: .15em;
  --focus-shadow: 0 0 0 var(--focus-size) var(--focus-color);
  box-shadow: var(--focus-shadow), var(--underline-shadow);
  transition: color .3s ease, box-shadow .3s ease;
}

.Link:hover,
.Link-is-accent-color {
  color: var(--accent-color);
}

.Link-is-juicy {
  padding: .5em;
  margin: -.5em;
}

.Link-without-underline,
.Link-without-underline:hover,
.Link-is-chip,
.Link-is-chip:hover,
.Link-with-right-arrow,
.Link-with-right-arrow:hover {
  --underline-size: 0em;
}

.Link-is-chip {
  color: rgba(var(--accent-color-rgb), .8);
  text-shadow: 0 0 0 rgba(var(--color-rgb), .8);
  background: rgba(var(--accent-color-rgb), .07);
  border: 0;
  padding: .125em .25em;
  border-radius: calc(1.6666 * var(--border-radius));
}

.Link-with-right-arrow::after {
  content: "\00a0â†’";
}

.Link:focus {
  outline: none;
}

.Link:focus-visible {
  --underline-size: 0em;
}

.Link:not(:focus-visible) {
  --focus-size: 0em;
}

.Button {
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;

  cursor: pointer;
  display: inline-block;
  text-align: center;

  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;

  position: relative;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  line-height: var(--line-height);
  margin: 0;
  padding: .6em 1em;

  border-radius: var(--border-radius);

  text-decoration: none;
  -webkit-tap-highlight-color: transparent;

  --active-box-shadow-color: transparent;
  --active-box-shadow: inset 0 .133em .333em var(--active-box-shadow-color);

  --active-overlay-box-shadow-color: transparent;
  --active-overlay-box-shadow: inset 0 0 0 9999em var(--active-overlay-box-shadow-color);

  --hover-box-shadow-color: transparent;
  --hover-box-shadow: inset 0 0 0 9999em var(--hover-box-shadow-color);

  --focus-box-shadow: 0 0 0 var(--focus-size) var(--focus-color);

  --border-color: transparent;
  --border-box-shadow: inset 0 0 0 var(--line-width) var(--border-color);

  --shadow-box-shadow: 0 var(--line-width) var(--line-width) rgba(var(--shadow-color-rgb), .075),
    0 .133em .267em rgba(var(--shadow-color-rgb), .075),
    0 .222em .667em 0 rgba(var(--shadow-color-rgb), .075),
    0 .444em 1.33em 0 rgba(var(--shadow-color-rgb), .075);

  --box-shadow: 0 0 0 0 transparent;

  box-shadow:
    var(--active-box-shadow),
    var(--active-overlay-box-shadow),
    var(--hover-box-shadow),
    var(--focus-box-shadow),
    var(--border-box-shadow),
    var(--box-shadow);

  --transition-duration: .3s;
  transition: box-shadow var(--transition-duration) ease;
}

.Button[disabled] {
  cursor: not-allowed;
  opacity: .5;
}

@media (hover: hover) {
  .Button:not([disabled]):hover {
    --hover-highlight-opacity: .2;
    --hover-box-shadow-color: rgb(255, 255, 255, var(--hover-highlight-opacity));
  }

  [data-theme="dark"] .Button:not([disabled]):hover {
    --hover-highlight-opacity: .1;
  }
}

.Button:not([disabled]):active {
  --transition-duration: 0s;
  --hover-box-shadow-color: transparent;
  --box-shadow: 0 0 0 0 transparent;
  --active-overlay-box-shadow-color: rgb(var(--shadow-color-rgb), .08);
  --active-box-shadow-color: rgb(var(--shadow-color-rgb), .2);
}

@media (hover: none) {
  .Button:not([disabled]):active {
    --active-overlay-box-shadow-color: rgb(var(--shadow-color-rgb), .3);
  }
}

.Button:focus {
  outline: none;
}

.Button:not(:focus-visible) {
  --focus-size: 0em;
}

.Button-is-elevated:not([disabled]) {
  --box-shadow: var(--shadow-box-shadow);
}

.Button-is-primary {
  background: var(--primary-background-color);
  color: var(--background-color);
}

.Button-is-secondary {
  background-color: var(--background-color);
  --background-accent-opacity: .05;
  --background-contrast-opacity: .06;
  --c1: rgba(var(--primary-background-color-rgb), var(--background-accent-opacity));
  --c2: rgba(var(--color-rgb), var(--background-contrast-opacity));
  background-image: linear-gradient(var(--c1), var(--c1)), linear-gradient(var(--c2), var(--c2));
}

[data-theme="dark"] .Button-is-secondary {
  --background-contrast-opacity: .25;
}

.Button-is-white {
  background: #fff;
}

.Button-is-large {
  font-size: 1.125em;
}

.Button-is-block {
  width: 100%;
  display: block;
}

.Button-is-bordered {
  --border-color: rgba(var(--color-rgb), .18);
}

.Button-is-bordered:focus-visible {
  --border-color: rgba(var(--focus-color-rgb), .8);
}

.Button-has-depth {
  --box-shadow: inset 0 calc(-1 * var(--line-width)) calc(1.125 * var(--line-width)) rgba(var(--shadow-color-rgb), .18);
}

.Button-has-double-depth {
  --box-shadow: inset 0 calc(-1 * var(--line-width)) calc(1.125 * var(--line-width)) rgba(var(--shadow-color-rgb), .36);
}

[data-theme="dark"] .Button-has-depth,
[data-theme="dark"] .Button-has-double-depth {
  --box-shadow: 0 0 0 1px transparent;
}

.Button-is-close {
  box-sizing: content-box;
  padding: 1em;
  height: .8em;
  width: .8em;
  line-height: 1;
}

.FormField {
  display: block;
}

.FormField-inline {
  display: inline-block;
}

.FormField--text {
  margin-bottom: .16875em;
}

.FormField--label {
  display: inline-block;
  font-size: .9em;
}

.FormField--description {
  display: block;
  font-size: .8em;
  line-height: calc(var(--line-height) * .9);
  color: rgba(var(--color-rgb), .6);
  margin: 0;
}

.Input {
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;

  cursor: text;
  display: block;

  margin: 0;
  padding: .6em .8em;
  width: 100%;
  font: inherit;
  line-height: var(--line-height);
  color: inherit;
  background: var(--input-background-color);

  border: 0;
  border-radius: var(--border-radius);

  --focus-box-shadow: 0 0 0 var(--focus-size) var(--focus-color);

  --inset-box-shadow-opacity: .18;
  --inset-box-shadow: inset 0 var(--line-width) calc(1.125 * var(--line-width)) rgba(var(--shadow-color-rgb), var(--inset-box-shadow-opacity));

  --border-color: rgba(var(--shadow-color-rgb), .18);
  --border-box-shadow: inset 0 0 0 var(--line-width) var(--border-color);

  box-shadow:
    var(--focus-box-shadow),
    var(--inset-box-shadow),
    var(--border-box-shadow);

  transition: box-shadow .3s ease;
}

.Input::placeholder {
  color: rgba(var(--color-rgb), .45);
}

.Input[disabled] {
  cursor: not-allowed;
  opacity: .5;
}

.Input-textarea {
  resize: none;
}

.Input-number::-webkit-inner-spin-button {
  display: none;
  opacity: 0;
  margin-right: 0;
  height: 2em;
  filter: contrast(1.5);
}

.Input:focus {
  outline: none;
  --border-color: rgba(var(--focus-color-rgb), .8);
  --border-top-color: transparent;
  --inset-box-shadow-opacity: 0;
}

.Input:not(:focus) {
  --focus-size: 0em;
}

.Checkbox {
  display: flex;
}

.Checkbox-inline {
  display: inline-flex;
  align-items: center;
}

.Checkbox--input {
  flex-shrink: 0;
  font-size: 1px;
  height: 1px;
  width: 1px;
  margin-top: -1px;
  margin-left: -1px;
  padding: 0;
  border: 0;
  clip: rect(1px 1px 1px 1px);
  clip: rect(1px, 1px, 1px, 1px);
  -webkit-clip-path: inset(0px 0px 99.9% 99.9%);
  clip-path: inset(0px 0px 99.9% 99.9%);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.Checkbox--label {
  position: relative;
  display: flex;
  cursor: pointer;
}

.Checkbox--label::before,
.Checkbox--label::after {
  content: "";
  box-sizing: border-box;
  display: inline-flex;
  flex-shrink: 0;
  height: 1.1875em;
  width: 1.1875em;
  margin-top: .125em;
  margin-right: .5em;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.Checkbox--label::before {
  background: var(--input-background-color);

  --focus-box-shadow: 0 0 0 var(--focus-size) var(--focus-color);

  --inset-box-shadow-opacity: .18;
  --inset-box-shadow: inset 0 var(--line-width) calc(1.125 * var(--line-width)) rgba(var(--shadow-color-rgb), var(--inset-box-shadow-opacity));

  --border-color: rgba(var(--shadow-color-rgb), .18);
  --border-box-shadow: inset 0 0 0 var(--line-width) var(--border-color);

  box-shadow:
    var(--inset-box-shadow),
    var(--border-box-shadow);

  transition: box-shadow .3s ease;
}

.Checkbox--input:focus-visible + .Checkbox--label::before {
  --border-color: rgba(var(--focus-color-rgb), .8);
  --inset-box-shadow-opacity: 0;
}

.Checkbox--label::after {
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: 0 0 0 var(--focus-size) var(--focus-color);
  transition: box-shadow .3s ease;
}

.Checkbox--input:not(:focus-visible) + .Checkbox--label::after {
  --focus-size: 0em;
}

.Checkbox--input:checked + .Checkbox--label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23fff' d='M.5 9L2.5 7 5.5 10 13.5 2 15.5 4 5.5 14z'/%3e%3c/svg%3e");
}

.Checkbox--input:indeterminate + .Checkbox--label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23fff' d='M1 6.5L15 6.5 15 9.5 1 9.5z'/%3e%3c/svg%3e");
}

.Checkbox--input:checked + .Checkbox--label::after,
.Checkbox--input:indeterminate + .Checkbox--label::after {
  background-color: var(--primary-background-color);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 65%;
}

.Checkbox--input[disabled] + .Checkbox--label {
  cursor: not-allowed;
  opacity: .5;
}

.Stack {
  --gap: 1.5rem;
}

.Stack > * + * {
  margin-top: var(--gap);
}

html, body {
  height: 100%;
  margin: 0;
}

body > nav {
  position: absolute;
  pointer-events: none;
  text-align: center;
  padding: 1em;
  width: 100%;

  a {
    color: inherit;
    text-decoration: none;
    pointer-events: all;
    padding: 0 .1em;
  }
}

main {
  display: grid;
  place-content: center;
  text-align: left;
  height: 100%;
  padding-bottom: 1em;
}

.Status {
  padding: .45em .8em .4em;
  border-radius: .25em;
  background: rgba(var(--color-rgb), .1);
}

.Status:empty {
  display: none;
}

.Status-is-warning {
  color: rgb(149, 110, 1);
  background: rgba(226, 184, 29, .14);

  html[data-theme="dark"] & {
    color: rgb(255, 188, 0);
    background: rgb(67, 65, 48, .8);
  }
}

.Status-is-error {
  color: rgb(229, 65, 37);
  background: rgba(242, 145, 128, .2);

  html[data-theme="dark"] & {
    color: rgb(229, 65, 37);
    background: rgba(152, 47, 28, .2);
  }
}

.Login {
  width: 22em;
  max-width: 100%;
  padding: 2em;
  background: #fff;
  box-shadow:
    0 0 0 .05em rgba(var(--color-rgb), .1),
    0 .2em .6em  rgba(var(--color-rgb), .1);
  border-radius: 1em;

  html[data-theme="dark"] & {
    background: rgba(var(--color-rgb), .03);
    box-shadow: 0 .15em .3em  rgba(0, 0, 0, .2);
  }

  h1 {
    display: none;
  }

  .Stack > .Status:empty {
    margin-top: 0;
  }
}
