html {
  font-size: 16px;
}

body {
  box-sizing: border-box;
  margin: auto;
  padding: 20px;
  width: 80%;
  min-width: 700px;
  font-size: 1rem;
}

#permissions {
  position: sticky;
  z-index: 1;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  background: white;
}

#permissions details {
  margin-bottom: .5em;
  border: 1px solid #EEE;
  background: #FEE;
  color: black;
}

#permissions details > summary {
  padding: .5em;
  background-color: #F11;
}

#permissions details > div {
  margin: .5em;
}

a {
  color: blue; /* fallback for old browsers */
  color: LinkText;
}

a:active {
  color: #EE0000;
}

textarea {
  color: unset;
}

textarea[readonly] {
  background-color: #DDDDDD;
}

input[type="button"] {
  display: inline-block;
  border: 1px solid #C1C1C1;
  border-radius: 5px;
  padding: 10px 14px;
  background-color: #EEEEEE;
  text-align: center;
  text-decoration: none;
  color: #333333;
  font-size: 1rem;
  text-transform: uppercase;
}

input[type="button"]:disabled {
  pointer-events: none;
  opacity: 0.6;
}

input[type="button"]:hover {
  background-color: #EBEBEB;
}

.header img {
  display: inline-block;
  margin-__MSG_@@bidi_end_edge__: .5rem;
  width: 3rem;
  height: 3rem;
  vertical-align: middle;
}

.header h1 {
  display: inline-block;
  margin: 1rem 0;
  padding: 0;
  vertical-align: middle;
  font-size: 1.5rem;
}

.info {
  overflow: auto;
}

.info > div > dt, .info > div > dd {
  margin: 0;
  padding: 0;
  display: inline;
  white-space: pre;
}

.info > div > dt {
  margin-__MSG_@@bidi_end_edge__: .5em;
}

.field {
  box-sizing: border-box;
  margin: 1.75rem 0 0 0;
  padding: 0;
  overflow: hidden;
}

.fieldLabel {
  float: __MSG_@@bidi_start_edge__;
  box-sizing: border-box;
  padding-__MSG_@@bidi_end_edge__: .5rem;
  width: 32%;
}

.fieldLabel h2 {
  margin: 0 0 .5rem 0;
  font-size: 1.125rem;
}

.fieldLabel p {
  margin: .5em 0;
  font-size: 1rem;
}

.lowlight {
  opacity: 0.6;
}

.fieldset {
  float: __MSG_@@bidi_end_edge__;
  box-sizing: border-box;
  width: 68%;
}

.fieldset textarea {
  box-sizing: border-box;
  width: 100%;
  height: 144px;
  resize: vertical;
  font-size: .875rem;
  word-break: break-all;
}

#resetButton {
  float: __MSG_@@bidi_start_edge__;
  background-color: #f6f8fa;
  color: #cf222e;
}

#resetButton:hover {
  background-color: #a40e26;
  color: white;
}

#submitButton {
  float: __MSG_@@bidi_end_edge__;
  background-color: #f6f8fa;
  color: #2da44e;
}

#submitButton:hover {
  background-color: #2c974b;
  color: white;
}

/* https://bootsnipp.com/snippets/featured/material-design-switch */
.material-switch {
  display: inline-block;
  position: relative;
}

.material-switch > input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.material-switch > input[type="checkbox"] + label {
  display: inline-block;
  position: relative;
  cursor: pointer;
  margin: 6px;
  border-radius: 8px;
  width: 40px;
  height: 16px;
  opacity: 0.3;
  background-color: rgb(0, 0, 0);
  box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;
}

.material-switch > input[type="checkbox"] + label::after {
  position: absolute;
  top: -4px;
  left: -4px;
  border-radius: 16px;
  width: 24px;
  height: 24px;
  content: "";
  background-color: rgb(255, 255, 255);
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease-in-out;
}

.material-switch > input[type="checkbox"]:checked + label {
  background-color: #5cb85c;
  opacity: 0.5;
}

.material-switch > input[type="checkbox"]:checked + label::after {
  background-color: inherit;
  left: 20px;
}

.material-switch > input[type="checkbox"]:focus + label {
  outline: .1em solid #4D90FE;
  transition-duration: 0s;
}

@media screen and (max-width: 720px) {
  body {
    width: 100%;
    min-width: initial;
  }
  .fieldLabel {
    padding: 0;
    width: 100%;
  }
  .fieldset {
    margin-top: .5rem;
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #333;
    color: #ccc;
  }

  #permissions {
    background: inherit;
  }

  #permissions details {
    border-color: #888;
    background-color: #FCC;
  }

  a {
    color: #4EA1FF;
  }

  textarea {
    background-color: #444;
  }

  textarea[readonly] {
    background-color: #333;
  }

  input[type="button"] {
    border-color: #888;
  }

  .lowlight {
    opacity: 0.8;
  }

  #resetButton,
  #submitButton {
    background-color: #444;
  }

  .material-switch > input[type="checkbox"] + label {
    background-color: #888;
  }
}
