.jstEditor {
  color: var(--body-color);
  background: var(--body-background);
  border-width: 0 1px 1px 1px;
  border-style: solid;
  border-color: var(--body-color);
}
.jstEditor textarea,
.jstEditor iframe {
  box-sizing: border-box;
  margin: 0;
  border: none;
  width: 100%;
  padding: 0.5em calc(0.5em + 1em) 0.5em 0.5em;
  min-height: 100px;
}
body.rtl .jstEditor textarea,
body.rtl .jstEditor iframe {
  padding: 0.5em 0.5em 0.5em calc(0.5em + 1em);
}
.toolbar_bottom .jstEditor {
  border-top-width: 1px;
  border-bottom-width: 0;
}

.jstEditor textarea:focus,
.jstEditor iframe:focus {
  border-color: #bee74b;
}
.jstElements {
  color: var(--body-color);
  background-color: var(--body-background);
  box-sizing: border-box;
  border: 1px solid;
  padding: 0.25em;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-start;
  align-items: center;
  row-gap: 0.125em;
  column-gap: 0.25em;
}
.jstGroup {
  box-sizing: border-box;
  padding: 0.125em;
  border: 1px solid var(--entry-sb-spacer);
  border-radius: 3px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-start;
  align-items: center;
  gap: 0.125em;
  select:only-child {
    border: none;
  }
}
.jstElements select,
.jstElements button {
  vertical-align: middle;
}
.jstElements select {
  border-radius: 3px;
}
.jstElements button {
  width: 2.8rem;
  height: 2.8rem;
  padding: 1px;
  border-style: solid;
  border-width: 1px;
  border-color: var(--toolbar-btn-border);
  background-color: var(--toolbar-btn-background);
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: 2rem;
  box-shadow: none;
  img {
    width: 80%;
    height: auto;
    vertical-align: middle;

    body.dark-mode &:not(.light-only):not(.dark-only) {
      /* Add some contrast and brightness to light icon only on dark mode */
      filter: var(--toolbar-btn-filter);
    }
  }
}
.jstElements button:hover,
.jstElements button:focus {
  border-color: var(--toolbar-btn-border-hover);
  background-color: var(--toolbar-btn-background-hover);
}
.jstElements button span {
  display: none;
}
.jstElements span {
  display: inline-block;
  vertical-align: top;
}
.jstElements span.jstSpacer {
  margin-inline-start: 0.25em;
  border-inline-start: 1px solid var(--entry-sb-spacer);
}
.jstElements > .jstSpacer:first-child,
.jstElements > .jstSpacer:last-child {
  display: none;
}
.jstSwitcher {
  display: flex;
  list-style: none;
  margin: 0;
  padding: inherit;
  border-top: 1px solid #999;
}
.jstSwitcher li {
  display: inline;
  margin: 0;
  padding: 0.125em 1em;
}
.jstSwitcher li.jstSwitcherCurrent {
  color: var(--switch-active-color);
  background: var(--switch-background);
  border-radius: 0 0 2px 2px;
}
.jstSwitcher a {
  color: var(--switch-color);
}
.jstDialog {
  display: flex;
  gap: 0.125em;
  flex-wrap: wrap;
  flex-direction: column;
  padding: 0.5em 1em;
  color: var(--body-color);
  background: var(--body-background);
  border: 1px solid var(--body-color);
  margin: auto;

  h1 {
    font-size: 1.125em;
    font-weight: bold;
    border-bottom: 1px solid;
    text-indent: initial;
    width: initial;
    margin-block-end: 0.5em;
    padding-block-end: 0;
  }

  .field {
    margin: 0.5em 0;
    display: grid;
    gap: 0.5em;
    grid-template-columns: 1fr 2fr;

    label {
      width: inherit;
    }
  }

  .form-buttons {
    margin-block-start: 1em;
    justify-content: flex-end;
  }
}

/* WYSIWYG Iframe */
.wysiwygIframe {
  border-width: 1px;
  border-style: solid;
  border-color: #000 #ccc #ccc #000;
  width: 100%;
}

/* Preview */
.wiki_preview {
  background: var(--wrapper-background);
  color: var(--body-color);
  padding: 2em;
}

.wiki_preview .wiki_markup {
  background: var(--content-background);
  max-width: 60em;
  margin: 0 auto;
}

.mfp-inline-holder .mfp-content {
  width: auto; /* Avoid default 100% */
}
