@font-face {
  font-family: "mononoki";
  src: url("/assets/mononoki-Regular-C0kkV2d1.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "mononoki";
  src: url("/assets/mononoki-Bold-0wVgHXtK.woff2") format("woff2");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "mononoki";
  src: url("/assets/mononoki-Italic-D7ywTva4.woff2") format("woff2");
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: "mononoki";
  src: url("/assets/mononoki-BoldItalic-NQv__mcG.woff2") format("woff2");
  font-weight: bold;
  font-style: italic;
}
/* ibm-plex-mono-regular - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-regular-kZzMVqjC.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-mono-italic - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-italic-CJhczni-.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-mono-500 - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-500-CPGfAHrL.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-mono-500italic - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 500;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-500italic-BjSwb0au.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-mono-600 - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-600-CM3ZhVO1.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-mono-600italic - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 600;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-600italic-C3-NBC9n.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-mono-700 - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-700-DHWaeise.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-mono-700italic - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 700;
  src: url('/assets/ibm-plex-mono-v19-cyrillic_cyrillic-ext_latin_latin-ext-700italic-C-o9ZXCb.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

focus-editor {
  --font-family-monospace: 'IBM Plex Mono', monospace;
}
@font-face {
  font-family: "Fira Code";
  src:
    url("/assets/FiraCode-Light-fY4l71KA.woff2") format("woff2"),
    url("/assets/FiraCode-Light-B1hbeU4w.woff") format("woff");
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: "Fira Code";
  src:
    url("/assets/FiraCode-Regular-jAL9VymT.woff2") format("woff2"),
    url("/assets/FiraCode-Regular-B8-kG0vS.woff") format("woff");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Fira Code";
  src:
    url("/assets/FiraCode-Medium--YTCSZkP.woff2") format("woff2"),
    url("/assets/FiraCode-Medium-B7pixCnj.woff") format("woff");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "Fira Code";
  src:
    url("/assets/FiraCode-SemiBold-BiAOBdH0.woff2") format("woff2"),
    url("/assets/FiraCode-SemiBold-C_qsBl7p.woff") format("woff");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "Fira Code";
  src:
    url("/assets/FiraCode-Bold-DzhvDiv4.woff2") format("woff2"),
    url("/assets/FiraCode-Bold-DeMYoWdo.woff") format("woff");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Fira Code VF";
  src:
    url("/assets/FiraCode-VF-Bc8wnsZt.woff2") format("woff2-variations"),
    url("/assets/FiraCode-VF-B-gPkBGS.woff") format("woff-variations");
  /* font-weight requires a range: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide#Using_a_variable_font_font-face_changes */
  font-weight: 300 700;
  font-style: normal;
}
.font-family-firacode {
  focus-editor .block em.underscore,
  focus-editor .block strong.underscore em {
    /* don't use italic since it breaks some ligatures , e.g. _|_ */
    font-style: normal;
  }
}
focus-editor {
  display: block;
  overflow-y: auto;
}
/* prevents flashing unrendered text */
focus-editor:not(:has(.focus-editor)) {
  color: transparent;
}
focus-editor {
  --line-height: 1.75rem;
  --color-grey-light: light-dark(#eee, #333);
  --color-grey-very-light: light-dark(
    rgba(240, 240, 240, 1),
    rgba(50, 50, 50, 1)
  );
  --color-grey: light-dark(rgba(175, 175, 175, 1), rgba(255, 255, 255, 0.5));
  --color-grey-lighter: #ccc;
  --color-text: var(--color-text, light-dark(#000, #fff));
  --color-background: var(--color-background, light-dark(#fff, #202020));

  --transition-duration: 0s;
  &.smooth-transition {
    --transition-duration: 0.2s;
  }
  @media (prefers-reduced-motion: reduce) {
    &.smooth-transition {
      --transition-duration: 0s;
    }
  }

  --space: 1rem;
  --border-radius: 4px;
  --space-left: 0px;
  --margin-left-factor: 0;
  --editor-vertical-padding: 0px;
  --editor-horizontal-padding: 0px;

  &.indent-headings,
  &.zen-mode {
    --space-left: 4rem;
    --margin-left-factor: 1;
    @media only screen and (max-width: 768px) {
      --space-left: 0px;
      --margin-left-factor: 0;
    }
  }

  &.indent-headings .block[data-placeholder]:before {
    left: calc(
      0px + var(--editor-vertical-padding) +
        calc(var(--space-left) * var(--margin-left-factor))
    );
  }

  &[color-scheme="light"] {
    color-scheme: light;
  }

  &[color-scheme="dark"] {
    color-scheme: dark;
  }

  font-family: var(
    --font-family-monospace,
    ui-monospace,
    SFMono-Regular,
    SF Mono,
    Menlo,
    Consolas,
    Liberation Mono,
    monospace
  );
  font-size: var(--font-size, 1rem);

  color: var(--color-text);
  background-color: var(--color-background);

  @media (hover) {
    .focus-editor[contenteditable="true"]:hover {
      cursor: text;
    }
  }

  &:not(.textarea) .focus-editor[contenteditable="true"] {
    outline: none;
  }
  .focus-editor {
    padding: var(--editor-vertical-padding) var(--editor-horizontal-padding);
    min-height: calc(100% - 2 * var(--editor-vertical-padding));
    &.hide-caret {
      caret-color: transparent;
    }
    .block,
    > br {
      line-height: var(--line-height);
      min-height: var(--line-height);
      padding-left: calc(var(--margin-left-factor) * var(--space-left));
      margin: 0;
    }
    .block:not(.code-block) {
      white-space: pre-wrap;
      word-wrap: break-word;
    }
    .block:not(.code-block) {
      transition:
        opacity var(--transition-duration),
        color var(--transition-duration),
        background-color 0.05s,
        transform var(--transition-duration);
    }

    .code-block {
      background: var(--color-grey-light);
      padding-left: var(--space);
      padding-right: var(--space);
      margin-left: calc(var(--margin-left-factor) * var(--space-left));
      margin-bottom: 0;
      white-space: pre-wrap;
      word-break: break-word;
    }
    code {
      background: var(--color-grey-light);
      padding: 0.1em 0.25em;
      margin-left: -0.25em;
      font-family: var(--font-family-monospace);
      &:after {
        content: "";
        margin-right: -0.25em;
      }
      border-radius: 4px;
    }
    .code-block-start {
      padding-top: calc(0.5 * var(--space));
      border-top-left-radius: var(--border-radius);
      border-top-right-radius: var(--border-radius);
      position: relative;
      &:after {
        content: "";
        position: absolute;
        left: calc(3em - 3px);
        height: var(--line-height);
        width: calc(100% - 2.8rem);
        background: var(--color-grey-light);
        opacity: 0.7;
        pointer-events: none;
      }
    }
    .code-block-end {
      padding-bottom: calc(0.5 * var(--space));
      border-bottom-left-radius: var(--border-radius);
      border-bottom-right-radius: var(--border-radius);
    }
    .h1,
    .h2,
    .h3,
    .h4,
    .h5,
    .h6 {
      font-size: var(--font-size);
      font-weight: bold;
    }

    .h1 {
      transform: translateX(
        calc(var(--margin-left-factor) * -0.3 * var(--space-left))
      );
    }
    .h2 {
      transform: translateX(
        calc(var(--margin-left-factor) * -0.45 * var(--space-left))
      );
    }
    .h3 {
      transform: translateX(
        calc(var(--margin-left-factor) * -0.61 * var(--space-left))
      );
    }
    .h4 {
      transform: translateX(
        calc(var(--margin-left-factor) * -0.77 * var(--space-left))
      );
    }
    .h5 {
      transform: translateX(
        calc(var(--margin-left-factor) * -0.91 * var(--space-left))
      );
    }
    .blockquote {
      margin-bottom: 0;
      --margin-left: 0.75rem;
      transform: translateX(
        calc(var(--margin-left-factor) * var(--space-left) + var(--margin-left))
      );
      margin-right: calc(0.5 * var(--space-left));
      padding-left: 1rem;
      position: relative;
      padding-right: 0.25rem;

      width: calc(
        100% -
          calc(
            var(--margin-left-factor) * var(--space-left) + var(--margin-left)
          ) -
          1.25rem
      );

      &:before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 0.5rem;
        background: var(--color-grey-lighter);
      }

      code {
        background: var(--color-grey-lighter);
      }
    }
    .blockquote:first-child,
    :not(.blockquote) + .blockquote {
      padding-top: 0.25rem;
    }
    .blockquote:has(+ *:not(.blockquote)),
    .blockquote:last-child {
      padding-bottom: 0.25rem;
    }
    .hr {
      position: relative;
      color: transparent;
      &:focus,
      &.with-caret {
        color: var(--color-text);
      }
      &:before {
        content: "";
        display: block;
        height: 3px;
        background: color-mix(in srgb, var(--color-grey) 30%, transparent);
        top: calc(50% - 1.5px);
        position: absolute;
        right: 0;
        width: calc(100% - var(--space-left));
        z-index: 0;
      }
    }
    .link {
      --default-color: currentColor;
      color: currentColor;
      text-decoration: none;
      display: inline;
      transition: color 0.1s;
      span {
        color: var(--color-grey-lighter);
        transition: color 0.1s;
      }

      @media (hover) {
        &:hover {
          text-decoration: underline;
          span {
            color: var(--default-color);
          }
        }
      }
    }
    .with-caret .link {
      text-decoration: underline;
      span {
        color: var(--default-color);
      }
    }
  }
}

focus-editor.textarea {
  outline: 1.5px solid color-mix(in srgb, currentColor 50%, transparent);
  border-radius: 2px;
  resize: both;
  --editor-vertical-padding: calc(0.5 * var(--space));
  --editor-horizontal-padding: var(--space);
  --rows: 5;
  @supports (x: attr(x type(*))) {
    --rows: attr(rows type(<number>), 5);
  }
  width: clamp(5em, 35em, 100%);
  min-height: calc(
    var(--line-height) * 2 + var(--editor-vertical-padding) +
      var(--editor-vertical-padding)
  );
  height: calc(
    var(--line-height) * var(--rows) + var(--editor-vertical-padding) +
      var(--editor-vertical-padding)
  );

  &:focus-within {
    outline: 2px auto Highlight;
    outline: 2px auto -webkit-focus-ring-color;
  }

  .focus-editor {
    height: calc(100% - 2 * var(--editor-vertical-padding));
    min-height: 3.5em;
    outline: none;
  }
  > textarea {
    display: none;
  }
}

focus-editor.no-wrap {
  & .focus-editor {
    .block:not(.code-block) {
      white-space: nowrap;
    }
  }
}

focus-editor[focus="paragraph"] {
  .block:not(.with-caret) {
    opacity: 0.15;
  }
  .block:has(+ .block.with-caret) {
    opacity: 0.3;
  }
  .block.with-caret + .block {
    opacity: 0.3;
  }

  .code-block:not(.with-caret) {
    opacity: 0.4;
    color: color-mix(in srgb, currentColor 20%, transparent);
  }
  .code-block:not(.with-caret):has(~ .code-block.with-caret),
  .code-block.with-caret ~ .code-block {
    opacity: inherit;
    color: currentColor;
  }

  .blockquote:not(.with-caret) {
    opacity: 0.4;
    color: color-mix(in srgb, currentColor 20%, transparent);
    &:before {
      background: color-mix(in srgb, currentColor 20%, transparent);
    }
  }
  .blockquote:not(.with-caret):has(~ .blockquote.with-caret),
  .blockquote.with-caret ~ .blockquote {
    opacity: inherit;
    color: currentColor;
    &:before {
      background: var(--color-grey);
    }
  }
}

focus-editor.zen-mode.enalarge-zen {
  @media (min-width: 768px) {
    .focus-editor {
      transform: scale(1.2);
      width: 80%;
      transform-origin: left top;
      height: 50%;
      --editor-vertical-padding: 2rem;
    }
  }
  @media (min-width: 1200px) {
    .focus-editor {
      transform: scale(1.3);
      width: min(70%, 55rem);
      transform-origin: left top;
      --editor-vertical-padding: 2rem;
    }
  }
}

focus-editor[hyphens] {
  .block:not(.code-block) {
    hyphens: auto;
  }
}

focus-editor[scroll] {
  .focus-editor .block:last-child {
    margin-bottom: 50%;
  }
}

focus-editor {
  .block[data-placeholder] {
    position: relative;
    &:before {
      content: attr(data-placeholder);
      position: absolute;
      top: 0;
      left: 0;
      line-height: var(--line-height);
      color: var(--color-grey);
      font-weight: normal;
      font-style: normal;
    }
  }
  .block[data-placeholder] + .block[data-placeholder]:before {
    display: none;
  }
  /* visual fix for safari: sometimes one br is inserted before placeholder */
  br:has(~ .block[data-placeholder]) {
    display: none;
  }
}
focus-editor[image-preview] {
  .link.image {
    span {
      &:after {
        --transition-duration: 0.7s;
        content: "";
        width: 1.2rem;
        height: 1.2rem;
        transition:
          height var(--transition-duration),
          width var(--transition-duration),
          transform var(--transition-duration);
        transform: translateY(0.2rem);
        background: var(--url);
        background-size: cover;
        background-position: center;
        position: relative;
        display: inline-block;
      }
    }
  }
  &[enlarge-image-preview] {
    .block.with-caret,
    .block:hover {
      .link.image {
        span {
          &:after {
            width: 8rem;
            height: 8rem;
            aspect-ratio: auto;
            transform: translateY(4rem);
            z-index: 99;
          }
        }
      }
    }
  }
}

focus-editor.highlight-current-paragraph .focus-editor {
  .block {
    opacity: var(--focus-opacity, 0.3);
    transition:
      opacity 0.2s,
      color var(--transition-duration),
      transform var(--transition-duration);
  }
  .block.with-caret {
    opacity: 1;
  }
  .code-block:not(.with-caret) {
    background: none;
    &:after {
      display: none;
    }
  }
}

focus-editor:has(.block .table) {
  --table-border-thickness: 3.5px;
  --color-border: var(--color-grey);

  .table {
    span {
      position: relative;
      --height-offest: 0.9em;
      --max-cell-width: inherit;
      &:first-child:before {
        content: "";
        position: absolute;
        left: var(--table-border-thickness);
        top: -0.55em;
        height: calc(100% + var(--height-offest));
        width: var(--table-border-thickness);
        background: var(--color-border);
      }
      &:after {
        content: "";
        position: absolute;
        right: var(--table-border-thickness);
        top: -0.55em;
        height: calc(100% + var(--height-offest));
        width: var(--table-border-thickness);
        background: var(--color-border);
      }
    }
  }
  .table-header-text.table-with-extra-class {
    span:last-child {
      display: none;
    }
  }
  .table-header-text {
    font-weight: bold;
  }
  .table-header-text,
  .table-header-separator,
  .table-row {
    white-space: pre;
  }
  .table-header-separator {
    position: relative;
    display: inline-block;
    color: color-mix(in srgb, currentColor 40%, transparent);
    @media print {
      color: transparent;
    }
    &:before {
      content: "";
      position: absolute;
      left: var(--table-border-thickness);
      top: calc(50% - calc(0.25 * var(--table-border-thickness)));
      height: var(--table-border-thickness);
      width: calc(100% - calc(2 * var(--table-border-thickness)));
      background: var(--color-border);
      z-index: 10;
    }
    span:before {
      background: var(--color-border) !important;
      top: 0 !important;
      height: calc(100%) !important;
    }
    span:after {
      background: var(--color-border) !important;
      top: 0 !important;
      height: calc(100%) !important;
    }
  }

  .table-row-even > span {
    padding: 0.25em 0;
    background-color: var(--color-grey-lighter);
    z-index: -1; /* otherwise it will cover the caret */
  }
  .table-row-even > span:first-child {
    background: linear-gradient(
      to right,
      transparent 0px,
      transparent var(--table-border-thickness),
      var(--color-grey-lighter) calc(var(--table-border-thickness) + 1px),
      var(--color-grey-lighter) 100%
    );
  }
  .table-row-even > span:last-child {
    background: linear-gradient(
      to right,
      var(--color-grey-lighter) 0px,
      var(--color-grey-lighter) calc(100% - var(--table-border-thickness)),
      transparent calc(var(--table-border-thickness) + 1px),
      transparent 100%
    );
  }

  /* TOP AND BOTTOM BORDER: TODO make this optional */
  .table-row-last {
    display: inline-block;
    position: relative;
    &:before {
      content: "";
      position: absolute;
      left: var(--table-border-thickness);
      bottom: calc(-1.7 * var(--table-border-thickness));
      height: calc(1.5 * var(--table-border-thickness));
      width: calc(100% - calc(2 * var(--table-border-thickness)));
      background: var(--color-border);
    }
  }
  .table-header-text {
    display: inline-block;
    position: relative;
    /* looks nicer, but the transition from markdown to table is harder :/ */
    line-height: 1em;
    transform: translateY(0.7em);
    > span {
      display: inline-block;
    }
    &:before {
      content: "";
      position: absolute;
      left: var(--table-border-thickness);
      top: calc(-1em + var(--table-border-thickness));
      height: calc(1.5 * var(--table-border-thickness));
      width: calc(100% - calc(2 * var(--table-border-thickness)));
      background: var(--color-border);
    }
  }
}
:root {
  --max-content-width: inherit;
  --primary-color: #00c7f9;
  --file-list-width: 20rem;
  --font-size-very-small: 0.6rem;
  --font-size-small: 0.8rem;
  --sidebar-width: 30rem;
  --text-color: #000;
  --grey-color: #aaa;
  --background-color: #f7f7f7;
  --background-color-light: #eee;
  --background-color-lighter: #ddd;
  --color-white-responsive: #fff;
  --color-black-responsive: #000;
  --invert-img-filter: invert(0);
  --font-family:
    ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono,
    monospace;
  --font-family-sans: "SF Pro Text", -apple-system, sans-serif;
  --letter-spacing: 0px;
  --vertical-border-margin: 1.5rem;
  --transition-duration: 0.3s;
  --text-indent: 0px;
  --min-height: 10rem;
  --focus-opacity: 0.1;
  --strong-shadow:
    rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px,
    rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px,
    rgba(0, 0, 0, 0.09) 0px -3px 5px;
}
@media screen and (prefers-color-scheme: dark) {
  :root {
    --text-color: #fff;
    --background-color: #222;
    --background-color-light: #333;
    --background-color-lighter: #444;
    --grey-color: #777;
    --color-white-responsive: #000;
    --color-black-responsive: #fff;
    --invert-img-filter: invert(1);
  }
}

body {
  font-family: var(--font-family);
  margin: 0;
  background: var(--background-color);
  color: var(--text-color);
}
body.font-family-ibm {
  --font-family: "IBM Plex Mono", ui-monospace, monospace;
}
body.font-family-firacode {
  --font-family: "Fira Code", ui-monospace, monospace;
}
@media screen {
  body.light-color-scheme {
    --text-color: #000;
    --grey-color: #aaa;
    --background-color: #f7f7f7;
    --background-color-light: #eee;
    --background-color-lighter: #ddd;
    --color-white-responsive: #fff;
    --color-black-responsive: #000;
    --invert-img-filter: invert(0);
  }
  body.dark-color-scheme {
    --text-color: #fff;
    --background-color: #222;
    --background-color-light: #333;
    --background-color-lighter: #444;
    --grey-color: #777;
    --color-white-responsive: #000;
    --color-black-responsive: #fff;
    --invert-img-filter: invert(1);
  }
}

focus-editor {
  --primary-color: var(--primary-color);
  --font-family-monospace: var(--font-family);
  --color-text: var(--text-color);
  --color-grey-light: var(--background-color-light);
  --color-grey-lighter: var(--background-color-lighter);
  background: none;
}
focus-editor > div {
  margin: 0 auto;
}
@media screen and (min-width: 900px) {
  focus-editor > div {
    margin-top: 0.5rem;
  }
}
@media screen and (max-width: 900px) {
  focus-editor {
    margin: 1rem;
  }
}

body,
#app,
.app-window {
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
}

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 1rem;
  background: var(--background-color);
  width: calc(100% - 2rem);
  color: var(--grey-color);
  text-align: right;
}
@media (hover) {
  .status-bar {
    background: color-mix(in srgb, var(--background-color) 25%, transparent);
  }
}

.files .icons {
  display: flex;
  flex-grow: 0;
  flex-shrink: 1;
  gap: 0.5rem;
}
.files .icons .history {
  filter: var(--invert-img-filter);
}
.files .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
}
.files .file-name .folder-path-text {
  opacity: 0.3;
}
.files .no-files-found {
  color: var(--grey-color);
}
.files ul {
  overflow-x: hidden;
}
.files li {
  display: block;
}
.files li.over {
  background: var(--background-color-lighter);
}
@media (hover) {
  .files li:not(.no-hover):hover {
    background: var(--background-color-light);
  }
}
.files li .icon {
  display: inline-block;
  width: 1rem;
}
.files li .icon img {
  margin-top: 0.25rem;
  height: 1rem;
  width: 1rem;
}
.files li.allow-dad {
  position: fixed;
  bottom: 0.5rem;
  gap: 0.5rem;
}
.files li.allow-dad *::selection {
  background-color: transparent;
}
@media (hover) {
  .files li .icon {
    opacity: 0;
  }
  .files li:hover {
    cursor: pointer;
  }
  .files li:hover .icon {
    opacity: 1;
  }
}
.files li.active {
  font-weight: bold;
}

.side {
  position: relative;
}
.side .files {
  position: sticky;
  top: 0;
}
.side ul {
  padding: 1rem;
  padding-top: 0rem;
}
@media (min-width: 900px) {
  .side ul {
    max-height: 100vh;
    overflow-y: scroll;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}
.side li {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  word-break: break-all;
}
.side .toggle-bar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1rem;
  height: 100%;
  background: var(--background-color-light);
}
@media (hover) {
  .side .toggle-bar:hover {
    background: var(--background-color-lighter);
    cursor: pointer;
  }
}

.side .files ul {
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.side .files ul li {
  padding: 0.1rem 1rem;
}
.side .files ul li.no-hover {
  min-height: 1.9em;
}
@media screen and (max-width: 900px) {
  .side .files ul li:first-child:not(.no-hover) {
    padding-top: 1rem;
  }
}

.main {
  padding-left: 3rem;
  padding-top: 0.5rem;
}

.side {
  font-size: var(--font-size-small);
}

.app-window {
  display: grid;
  grid-template-columns: 1rem 1fr;
  transition: 0.2s;
}
.app-window.sidebar-expanded {
  grid-template-columns: var(--file-list-width) 1fr;
}
.app-window:not(.sidebar-expanded) .side > div:not(.toggle-bar) {
  display: none;
}
.app-window.show-file-versions {
  grid-template-columns: var(--file-list-width) var(--file-list-width) 1fr;
}
.app-window.show-file-versions:not(.sidebar-expanded) {
  grid-template-columns: 1rem 20rem 1fr;
}
.app-window.show-file-versions .file-versions {
  box-shadow: var(--strong-shadow);
}
.app-window.not-logged-in {
  display: grid;
  place-content: center;
  grid-template-columns: min(25rem, 100%);
}

@media screen and (min-width: 1400px) {
  .app-window.sidebar-expanded:not(.not-logged-in) {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
  .app-window.sidebar-expanded:not(.not-logged-in).show-file-versions {
    grid-template-columns: var(--sidebar-width) 20rem 1fr;
  }
}
focus-editor > div {
  max-width: 50rem;
}

focus-editor.full-width-editor > div {
  max-width: calc(100vw - 6rem);
}

.sidebar-expanded focus-editor.full-width-editor > div {
  max-width: calc(100vw - 6rem - var(--sidebar-width));
}

focus-editor [contenteditable] > div:last-child {
  margin-bottom: 4rem;
}
@media screen and (min-width: 900px) {
  focus-editor [contenteditable] > div:last-child {
    margin-bottom: calc(50vh - 5rem);
  }
}

.drop-wrapper:has(> textarea) {
  display: grid;
}

.side ul li {
  padding: 0rem 0.5rem;
}
.side .header {
  display: flex;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  color: var(--grey-color);
}
@media screen and (min-width: 900px) {
  .side .header {
    margin-right: 1rem;
    gap: 0.3rem;
  }
}
.side .header img {
  height: 0.9rem;
  width: 0.9rem;
}
@media (hover) {
  .side .header .name:hover {
    cursor: pointer;
  }
}
.side .header .version,
.side .header .github,
.side .header .close {
  opacity: 0.4;
  font-size: 0.5rem;
  display: flex;
  align-items: flex-end;
  color: var(--text-color);
}
.side .header .version {
  line-height: 1.5em;
}
.side .header .github {
  flex-grow: 1;
  display: flex;
  justify-content: end;
  filter: var(--invert-img-filter);
}
@media screen and (max-width: 900px) {
  .side .header .github {
    display: none;
  }
}
.side .header .close {
  filter: var(--invert-img-filter);
  flex-grow: 1;
  justify-content: end;
  margin-right: 0.25rem;
}
@media screen and (min-width: 900px) {
  .side .header .close {
    display: none;
  }
}
.side .header .close img {
  height: 0.7rem;
  width: 0.7rem;
}

.global-error-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--background-color) 25%, transparent);
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.5em;
  backdrop-filter: blur(3px);
}
.global-error-message a {
  display: block;
  opacity: 0.5;
  cursor: pointer;
  margin-top: 0.25rem;
}

.button-more {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
}
@media print {
  .button-more {
    display: none;
  }
}
.button-more .icon {
  padding: 4px 6px;
  border-radius: 4px;
  position: absolute;
  top: -2px;
  right: 0;
  background: color-mix(in srgb, var(--background-color) 75%, transparent);
}
@media (hover) {
  .button-more .icon:hover {
    cursor: pointer;
    background: var(--background-color-lighter);
  }
}
.button-more .icon img {
  margin-top: 2px;
  height: 1rem;
  width: 1rem;
  filter: var(--invert-img-filter);
}
.button-more .icon input[type=checkbox] {
  opacity: 0;
  position: absolute;
  height: 100%;
  width: 100%;
  left: -3px;
  top: -3px;
  z-index: 999;
}
.button-more ul.menu {
  margin-top: 2rem;
  padding: 0;
  background: var(--background-color-light);
  border-radius: 4px;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 12px 28px 0px, rgba(0, 0, 0, 0.1) 0px 2px 4px 0px, rgba(255, 255, 255, 0.05) 0px 0px 0px 1px inset;
  font-size: 0.9rem;
}
.button-more ul.menu li {
  list-style: none;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
@media (hover) {
  .button-more ul.menu li:hover {
    background: var(--background-color-lighter);
    cursor: pointer;
  }
}
.button-more ul.menu li.active {
  font-weight: bold;
}
.button-more ul.menu li.active .shortcut {
  font-weight: normal;
}
.button-more ul.menu li .shortcut {
  letter-spacing: -1px;
  color: var(--grey-color);
}
@media screen and (max-width: 900px) {
  .button-more ul.menu li .shortcut {
    display: none;
  }
}
.button-more ul.menu li.border-top {
  border-top: 2px solid var(--background-color-lighter);
}
.button-more ul.menu li.border-bottom {
  border-bottom: 2px solid var(--background-color-lighter);
}
.button-more ul.menu ul.menu {
  margin-top: 0;
  position: absolute;
  left: -20rem;
  width: 20rem;
  top: 0;
}
@media screen and (max-width: 900px) {
  .button-more ul.menu ul.menu {
    left: -5.2rem;
  }
}

focus-editor .focus-editor .with-caret .link {
  text-decoration: none;
}
focus-editor .focus-editor .link.inline:hover {
  /* background: #8efbd2; */
  text-decoration: underline;
}
focus-editor .focus-editor .link:hover {
  text-decoration: none;
}

#audio-preview-container {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  bottom: 1rem;
  right: 1rem;
}
#audio-preview-container .close-button {
  position: absolute;
  top: calc(50% - 0.5em);
  right: -0.8rem;
}
#audio-preview-container .close-button:hover {
  cursor: pointer;
}
#audio-preview-container.visible {
  opacity: 1;
  pointer-events: inherit;
  z-index: 10;
}
#audio-preview-container audio {
  margin-top: -1.2rem;
  padding-top: 1.5rem;
  display: block;
}

focus-editor[image-preview] .link.image span:after {
  height: 15em;
  transition: none;
  background-color: var(--color-grey-light);
  background-size: contain;
  background-position: left;
  position: relative;
  display: block;
  background-repeat: no-repeat;
  width: inherit;
  margin-bottom: 1rem;
}

.display-single-image {
  padding-top: 0.5rem;
  height: calc(100vh - 2rem);
  width: calc(100% - 1rem);
  display: grid;
  place-content: center;
}
.display-single-image img, .display-single-image video {
  width: calc(100% - 2rem);
  margin-left: 1rem;
  max-height: calc(100vh - 2rem);
  object-fit: contain;
  display: block;
}

button {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  background: var(--text-color);
  color: var(--background-color);
  border: 0px;
  border-radius: 4px;
}

.login {
  color: var(--color-black-responsive);
  padding: 2rem 1.5rem;
  border-radius: 4px;
  --font-family: var(--font-family-sans);
  font-family: var(--font-family);
}
.login button {
  background-color: var(--primary-color);
  cursor: pointer;
}
.login .headline {
  display: grid;
  place-content: center;
}
.login .headline .icon {
  width: 4rem;
  margin: 0 auto;
  margin-bottom: 4rem;
}
@media screen and (max-width: 900px) {
  .login .headline .icon {
    width: 4rem;
    margin-bottom: 3rem;
  }
}
.login label {
  font-size: var(--font-size-small);
  color: var(--grey-color);
  line-height: 1.5em;
}
.login input[type=text],
.login input[type=password] {
  border: 0px;
  border-bottom: 1px solid var(--grey-color);
  padding: 0.5rem 0rem;
  font-size: 1rem;
  font-family: var(--font-family);
  display: block;
  margin-bottom: 1rem;
  width: 100%;
  color: var(--color-black-responsive);
  background: none;
  border-color: #bbb;
  margin-bottom: 2rem;
  outline: none;
  border-radius: 0;
}
.login input[type=text]::placeholder,
.login input[type=password]::placeholder {
  color: var(--grey-color);
}
.login input[type=text]:focus, .login input[type=text]:active,
.login input[type=password]:focus,
.login input[type=password]:active {
  border-bottom: 2px solid #22a8fa;
  margin-bottom: calc(2rem - 1px);
}
.login div:has(> label) {
  display: flex;
  gap: 1rem;
}
.login .error {
  margin-bottom: 1.5rem;
  padding: 0.75rem 0.75rem;
  background: #ffeaea;
  color: #f67474;
  border-radius: 4px;
  line-height: 1.5em;
  font-size: 0.85rem;
  margin-left: -0.75rem;
  width: 100%;
}
.login .error p {
  margin: 0;
  margin-bottom: 0.5rem;
}
.login .input {
  position: relative;
}
.login .input label {
  position: absolute;
  top: -1em;
}
.login .endpoint .message,
.login .endpoint .input {
  display: none;
}
.login .endpoint.show-endpoint .input {
  display: block;
}
.login .endpoint.hide-endpoint .message {
  display: block;
}
.login .message {
  font-size: var(--font-size-small);
  line-height: 1.5em;
  padding-bottom: 1.5rem;
}
.login .message:hover {
  cursor: pointer;
  text-decoration: underline;
}
@media (min-width: 900px) {
  .login .half-width {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .login .half-width button {
    margin-top: 0;
  }
}
@media (max-width: 900px) {
  .login {
    box-shadow: none;
    background: none;
  }
  .login input[type=text],
  .login input[type=password] {
    background: none;
  }
  .login button {
    width: 100%;
    margin-top: 1.5rem;
  }
}

.login {
  opacity: 0;
}

.not-logged-in .login {
  opacity: 1;
  animation: fade 0.5s linear;
}
@keyframes fade {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.copyright-badge {
  display: flex;
  font-size: 0.7rem;
  margin-top: 1rem;
  align-items: center;
  color: var(--grey-color);
  justify-content: center;
  font-family: var(--font-family-sans);
}
.copyright-badge a {
  color: currentColor;
}
.copyright-badge a.icon {
  display: block;
  opacity: 0.25;
  transition: opacity 0.5s;
  margin-right: 0.5rem;
}
.copyright-badge a.icon img {
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.2rem;
}
@media (hover) {
  .copyright-badge a.icon:hover {
    opacity: 1;
  }
}

.copyright-badge {
  filter: saturate(0);
  opacity: 0.5;
  transition: filter 0.5s, opacity 0.5s;
}
.copyright-badge:hover {
  filter: saturate(1);
  opacity: 1;
}

@media screen and (max-width: 900px) {
  .app-window {
    display: block;
  }
  .app-window.sidebar-expanded:not(.not-logged-in) {
    display: block;
  }
  .app-window .button-more {
    top: 1rem;
  }
  .app-window.sidebar-expanded .button-more {
    top: calc(1rem + 100dvh);
  }
  .app-window:not(.sidebar-expanded) .side {
    top: 1rem;
  }
  .app-window.show-file-versions .main {
    display: none;
  }
  .files li .icon {
    opacity: 1;
  }
  .files li:first-child {
    margin-top: 0.5rem;
  }
  .side {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--background-color);
  }
  .side .toggle-bar {
    width: 100%;
    height: 1rem;
    position: absolute;
    top: 0;
    bottom: unset;
    right: 0;
  }
  .side ul {
    height: 100dvh;
    overflow: scroll;
    margin: 0;
    padding: 0;
  }
  .side ul li,
  .side ul li.actions {
    padding-left: 1.5rem;
    padding-right: 0.5rem;
  }
  .side ul li.actions {
    margin-bottom: 0rem;
  }
  .app-window:not(.sidebar-expanded) .side .toggle-bar {
    position: fixed;
    top: 0px;
    border-top: 1px solid var(--color-white-responsive);
    display: none;
  }
  .main {
    padding-left: 0;
    padding-top: 0;
  }
}
.file-versions {
  padding: 0.75rem 1rem;
  font-size: var(--font-size-small);
}
.file-versions .file-versions-container {
  position: sticky;
  top: 1.75rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.file-versions header {
  position: sticky;
  top: 0;
  padding-bottom: 1rem;
  background: var(--background-color);
}
.file-versions ul {
  padding: 0;
  margin: 0;
}
.file-versions ul li {
  list-style: none;
  line-height: 1.5em;
}
@media (hover) {
  .file-versions ul li:hover {
    cursor: pointer;
    background: var(--background-color-light);
  }
}
.file-versions ul li.hide {
  display: none;
}
.file-versions ul li.active {
  font-weight: bold;
}
.file-versions .restore-or-cancel-versioning {
  display: flex;
  gap: 1rem;
}
.file-versions .restore-or-cancel-versioning button {
  margin-top: 0;
}

#jump-to-file-bar {
  --width: min(90vw, 40rem);
  --height: 2.5rem;
  width: var(--width);
  position: fixed;
  left: calc(50% - var(--width) / 2 - 1rem);
  top: calc(35% - var(--height) / 2);
  background: var(--background-color);
  box-shadow: rgba(50, 50, 50, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
  z-index: 999;
  padding: 0.5rem 0;
  border-radius: 4px;
  max-height: 50vh;
  overflow-y: auto;
  padding-top: 0;
}
#jump-to-file-bar input {
  width: calc(100% - 2rem);
  border: 0px;
  outline: none;
  font-size: 1.2rem;
  background: none;
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: 1rem;
  padding: 0.75rem 0;
  background: var(--background-color);
  margin-top: 0.5rem;
  margin: 0 1rem;
}
#jump-to-file-bar .file-list {
  min-height: 2rem;
  overflow-y: auto;
  max-height: calc(50vh - 4rem);
  padding: 0 1rem;
}
#jump-to-file-bar .file-list .file-item {
  padding: 0.5rem 0;
}
#jump-to-file-bar .file-list .file-item.selected {
  font-weight: bold;
}
#jump-to-file-bar .file-list .file-item:hover {
  text-decoration: underline;
  cursor: pointer;
}
#jump-to-file-bar .file-list .file-item.clear-history {
  font-size: var(--font-size-very-small);
  text-align: right;
  color: var(--grey-color);
}
#jump-to-file-bar .file-list .file-item.clear-history:hover {
  color: currentColor;
}

@media print {
  :root {
    --background-color: none;
    --text-color: #000;
  }
  body {
    font-size: 10pt;
  }
  .status-bar,
  .side {
    display: none;
  }
  .app-window {
    display: block !important;
  }
  .main {
    padding: 0;
  }
}