
:root {
  --ui-fg-color: #222f3e;
  --ui-bg-color: #FDFDFD;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--ui-bg-color);
  color: var(--ui-fg-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tox-tinymce {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font: menu;
}

.tox:not(.tox-tinymce-inline) .tox-editor-header {
    border-bottom: none;
    box-shadow: none;
    transition: initial;
}



a#logo {
  display: block;
  cursor: pointer;
  width: 28px;
  height: 28px;
  padding: 2px;
  background: url("../assets/hypertext-round-icon.svg") center center no-repeat;
  justify-self: flex-end;
  align-self: center;
  margin-left: auto;
  margin-right: 5px;

}

.not-supported {
  font-family: system-ui;
  font-size: 1.5rem;
  padding: 20px;
  margin: 200px auto;
  color: var(--ui-fg-color);
  max-width: 700px;
  border: 1px solid #020887;
  text-align: center;
  align-self: center;

}

.cke_1.cke_chrome, .cke_chrome {
  border: none;
}

textarea.cke_source {
  padding: 2rem !important;
  max-width: 95vw;
  font-size: 1rem !important;
}

#cke_tooltip {
  display: none !important;
}

.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) {
  border-right: 1px solid #ddd !important;
}

.tox .tox-sidebar-wrap {
  /*flex-direction: row-reverse !important;*/
}

#css-wrapper {
  width: 500px;
  display: flex;
  flex-direction: column;
}

#css-header {
  padding: 12px 8px 8px;
  border-bottom: 1px solid #ccc;
  height: 46px;
  display: flex;
  justify-content: space-between;
}

#css-header .tox-icon {
  padding-right: 5px;
  cursor: pointer;
}

#css-editor {
  width: 500px;
  height: calc(100% - 46px);
}

.toolbar-closed {
  transform: translateY(100%);
  transition: transform ease-out 0.3s;
}

.toolbar-open {
  transform: translateY(0);
  transition: transform ease-out 0.3s;
}

input::placeholder {
  color: #ccc;
}


.tox .tox-editor-header {
  background-color: var(--ui-bg-color);
}


.tox .tox-menubar {
  font: menu;
  background-color: var(--ui-bg-color);
  color: var(--ui-fg-color);
}

.tox .tox-menubar svg {
  transform: scale(0.75);
}

.tox .tox-menubar svg path {
  fill: var(--ui-fg-color);
}

.tox .tox-mbtn__select-label {
  color: var(--ui-fg-color);
}

.tox-icon .tox-tbtn__icon-wrap {
  color: var(--ui-fg-color);
}

.tox-platform-touch .tox-mbtn__select-label {
  display: none;
}

html.file-menu .tox-menubar .tox-mbtn__select-label {
  display: initial;
}

html.file-menu .tox-menubar .tox-tbtn__icon-wrap {
  display: none;
}


.tox .tox-mbtn:focus:not(:disabled) .tox-mbtn__select-label {
  color: var(--ui-fg-color);
}

.tox .tox-mbtn:focus:not(:disabled) svg path {
  color: var(--ui-fg-color);
}

.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) .tox-mbtn__select-label {
  color: var(--ui-fg-color);
}

.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) svg path {
  fill: var(--ui-fg-color);
}

.tox .tox-mbtn--active {
  fill: var(--ui-fg-color);
}

.tox .tox-mbtn--active svg path {
  fill: var(--ui-fg-color);
}

.tox .tox-mbtn--active .tox-mbtn__select-label {
  color: var(--ui-fg-color);
  fill: var(--ui-fg-color);
}

.tox .tox-mbtn:focus:not(:disabled) {
  color: var(--ui-fg-color);
  fill: var(--ui-fg-color);
}


html.dark-mode {
  filter: invert(100%) hue-rotate(180deg);
  background-color: var(--ui-fg-color);
}

html.dark-mode img, html.dark-mode a#logo {
  filter: none;

}

html.dark-mode .tox-menubar {
  /*filter: invert(100%) hue-rotate(180deg);*/
}

.CodeMirror * {
  font-size: 0.9rem !important;
}

@media (prefers-color-scheme: dark) {

  html {
    filter: invert(100%) hue-rotate(180deg);
    /*background-color: var(--ui-fg-color);*/
  }

  html img, html a#logo {
    filter: none;
  }

  html .tox-menubar {
    /*filter: invert(100%) hue-rotate(180deg);*/
  }

  html.dark-mode {
    filter: none;
  }

  html.dark-mode img, html.dark-mode a#logo {
    filter: none;
  }

  html.dark-mode .tox-menubar {
    filter: none;
  }

}

@media (display-mode: window-controls-overlay) {

  :root {
    --ui-fg-color: #fff;
    --ui-bg-color: #020887;
  }

  body{
    margin-top: env(titlebar-area-height, 33px);
  }

  .tox .tox-menubar {
    position: fixed;
    left: env(titlebar-area-x, 0);
    top: env(titlebar-area-y, 0);
    width: env(titlebar-area-width, 100%);
    height: env(titlebar-area-height, 33px);
    -webkit-app-region: drag;
    app-region: drag;
    overflow: hidden;
  }

  .tox-mbtn, #logo {
    -webkit-app-region: none;
    app-region: none;
  }

}


@media (display-mode: window-controls-overlay) or (display-mode: browser) {

  :root {
    --ui-fg-color: #fff;
    --ui-bg-color: #020887;
  }
  
  .tox .tox-mbtn--active .tox-mbtn__select-label {
    color: var(--ui-bg-color);
    fill: var(--ui-bg-color);
  }

  .tox .tox-mbtn--active svg path {
    fill: var(--ui-bg-color);
  }

  .tox .tox-mbtn:focus:not(:disabled) .tox-mbtn__select-label {
    color: var(--ui-bg-color);
  }


  .tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) .tox-mbtn__select-label {
    color: var(--ui-bg-color);
  }

  .tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) svg path {
    fill: var(--ui-bg-color);
  }

}