/* ----------------------------------------- */
/* Code Mirror in system                     */
/* ----------------------------------------- */
[data-theme][data-color-scheme="dark"] {
  &.pf2e.item.sheet form .tab.active.rules .rule-editing > .cm-editor,
  &.pf2e.item.sheet form .item-rules .rule-editing > .cm-editor {
    background-color: var(--dui-input-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--dui-input-border-color);
    color: var(--dui-input-text-color);
  }

  .ͼ2 .cm-content {
    caret-color: white;
  }

  .ͼ2 .cm-gutters {
    background-color: var(--application-bg);
    border-right: 1px solid var(--color-primary-2);
    border: unset;
  }

  .ͼ2 .cm-activeLineGutter {
    background-color: var(--color-primary-1);
    color: black;
  }

  .ͼ2 .cm-activeLine {
    background-color: color-mix(in srgb, var(--color-primary-2) 20%, transparent);
  }

  .ͼ1.cm-focused .cm-matchingBracket {
    background-color: yellow;
    color: black;
    border-radius: 3px;
    box-shadow: 0px 2px 3px black;
  }

  // strings
  .ͼe {
    color: red; // var(--color-level-error) not bright enough
  }

  // numbers
  .ͼd {
    color: greenyellow;
  }

  // bools
  .ͼc {
    color: var(--color-level-info);
  }

  // null
  .ͼb {
    color: rgb(217, 31, 217);
  }

  // red triangle
  .ͼ1 .cm-lintPoint:after {
    border-bottom: 4px solid var(--primary-light);
  }
}

/* ----------------------------------------- */
/* Code Mirror module                        */
/* ----------------------------------------- */
[data-theme] {
  .CodeMirror {
    cursor: text;
    background: white;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
  }
}
