:root {
  --border-radius: 4px;
  --box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
  --toast-width: 400px;
  --toast-gap: 20px;
  --toast-innerGap: 8px;
  --toast-padding: 8px;

  --primary: #222;
  --secondary: #ddd;
  --accent: #82b1ff;
  --success: #4caf50;
  --warning: #fb8c00;
  --error: #b00020;
  --info: #2196f3;

  --background: #fff;
  --background-light: #e8e8e8;
  --background-accent: #e6e6e6;

  --text-primary: #000;
  --text-secondary: #fff;
  --text-background: #fff;

  --border-color: #aaa;
  --border-color-light: #ccc;
  --border-color-hover: #000;

  --input-txt: var(--text-primary);
  --input-txt-disabled: #555;
  --input-bkg: #eee;
  --input-bkg-disabled: #ccc;
  --input-border-color: #ccc;
  --input-border-color-hover: #aaa;
  --input-border-color-disabled: #ccc;

  --focus-outline-width: 2px;
  --focus-outline-color: #ccc;

  --btn-bkg: #eee;
  --btn-bkg-active: #333;
  --btn-bkg-hover: #777;
  --btn-bkg-focus: #777;
  --btn-bkg-disabled: #eee;
  --btn-txt: var(--text-primary);
  --btn-txt-hover: #fff;
  --btn-txt-focus: #fff;
  --btn-txt-active: #fff;
  --btn-txt-disabled: #aaa;
  --btn-txt-txt: #777;
  --btn-txt-txt-hover: #000;
  --btn-txt-txt-disabled: #ccc;
  --btn-txt-txt-active: #000;

  --list-bkg: #fff;
  --list-item-txt: #000;
  --list-item-bkg: #fff;
  --list-item-txt-hover: #000;
  --list-item-bkg-hover: #ddd;
  --list-item-bkg-active: #ccc;

  --table-selected: #222;
  --table-selectedDisabled: #999;
  --table-rowBackground: #f4f4f4;
  --table-rowBackgroundEven: #f0f0f0;
  --table-checkedRowBackgroundColor: #d0d0d0;
  --table-headerBackgroundColor: #dfdfdf;
  --table-hoveredRowBackgroundColor: #ddd;
  --table-selectedBackgroundColor: #d0d0d0;
  --table-selectedAreaBackgroundColor: #0003;

  --checkbox-border: #999;
  --checkbox-borderDisabled: #ccc;
  --checkbox-borderHover: #222;

  --mention: #60f;
  --mention-bg: #50f2;
  --mention-hover-bg: #50f4;
}

.dark-theme {
  --primary: #242526;
  --secondary: #424242;
  --accent: #82b1ff;
  --success: #4caf50;
  --warning: #ffc107;
  --error: #ff5252;
  --info: #2196f3;

  --background: #18191a;
  --background-light: #242526;
  --background-accent: #101010;

  --text-primary: #fff;
  --text-secondary: #fff;
  --text-background: #000;

  --border-color: #424242;
  --border-color-light: #303030;
  --border-color-hover: #fff;

  --input-txt: var(--text-primary);
  --input-txt-disabled: #999;
  --input-bkg: #202020;
  --input-bkg-disabled: #222;
  --input-border-color: #333;
  --input-border-color-hover: #555;
  --input-border-color-disabled: #282828;

  --focus-outline-width: 2px;
  --focus-outline-color: #777;

  --btn-bkg: #505050;
  --btn-bkg-active: #404040;
  --btn-bkg-hover: #303030;
  --btn-bkg-focus: #303030;
  --btn-bkg-disabled: #272727;
  --btn-txt: var(--text-primary);
  --btn-txt-hover: #fff;
  --btn-txt-focus: #fff;
  --btn-txt-active: #fff;
  --btn-txt-disabled: #666;
  --btn-txt-txt: #999;
  --btn-txt-txt-hover: #fff;
  --btn-txt-txt-disabled: #555;
  --btn-txt-txt-active: #fff;

  --list-bkg: #18191a;
  --list-item-txt: #fff;
  --list-item-bkg: #18191a;
  --list-item-txt-hover: #fff;
  --list-item-bkg-hover: #333;
  --list-item-bkg-active: #444;

  --table-selected: #aaa;
  --table-selectedDisabled: #555;
  --table-rowBackground: #202020;
  --table-rowBackgroundEven: #222;
  --table-checkedRowBackgroundColor: #333;
  --table-headerBackgroundColor: #262626;
  --table-hoveredRowBackgroundColor: #2f2f2f;
  --table-selectedBackgroundColor: #333;
  --table-selectedAreaBackgroundColor: #fff3;

  --checkbox-border: #777;
  --checkbox-borderDisabled: #444;
  --checkbox-borderHover: #ccc;

  --mention: #95f;
  --mention-bg: #0006;
  --mention-hover-bg: #50f2;
}

a {
  text-decoration: none;
}

a:focus {
  outline: none;
}

@media screen and (min-width: 767px) {
  a:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline-color) !important;
  }
}

.row {
  display: flex;
  flex-wrap: wrap;
  --rg: 12px;
  --rg2: calc(var(--rg) / 2);
  gap: var(--rg);
}

[class*='col-'] {
  flex: 1 1 0;
  min-width: 0;
}

.col {
  flex: 1 1 0;
}

.col-1 {
  flex: 0 0 calc(8.333% - var(--rg2));
  max-width: calc(8.333% - var(--rg2));
}
.col-2 {
  flex: 0 0 calc(16.666% - var(--rg2));
  max-width: calc(16.666% - var(--rg2));
}
.col-3 {
  flex: 0 0 calc(25% - var(--rg2));
  max-width: calc(25% - var(--rg2));
}
.col-4 {
  flex: 0 0 calc(33.333% - var(--rg2));
  max-width: calc(33.333% - var(--rg2));
}
.col-5 {
  flex: 0 0 calc(41.666% - var(--rg2));
  max-width: calc(41.666% - var(--rg2));
}
.col-6 {
  flex: 0 0 calc(50% - var(--rg2));
  max-width: calc(50% - var(--rg2));
}
.col-7 {
  flex: 0 0 calc(58.333% - var(--rg2));
  max-width: calc(58.333% - var(--rg2));
}
.col-8 {
  flex: 0 0 calc(66.666% - var(--rg2));
  max-width: calc(66.666% - var(--rg2));
}
.col-9 {
  flex: 0 0 calc(75% - var(--rg2));
  max-width: calc(75% - var(--rg2));
}
.col-10 {
  flex: 0 0 calc(83.333% - var(--rg2));
  max-width: calc(83.333% - var(--rg2));
}
.col-11 {
  flex: 0 0 calc(91.666% - var(--rg2));
  max-width: calc(91.666% - var(--rg2));
}
.col-12 {
  flex: 0 0 calc(100% - var(--rg2));
  max-width: calc(100% - var(--rg2));
}

@media (min-width: 576px) {
  .col-sm-1 {
    flex: 0 0 calc(8.333% - var(--rg2));
    max-width: calc(8.333% - var(--rg2));
  }
  .col-sm-2 {
    flex: 0 0 calc(16.666% - var(--rg2));
    max-width: calc(16.666% - var(--rg2));
  }
  .col-sm-3 {
    flex: 0 0 calc(25% - var(--rg2));
    max-width: calc(25% - var(--rg2));
  }
  .col-sm-4 {
    flex: 0 0 calc(33.333% - var(--rg2));
    max-width: calc(33.333% - var(--rg2));
  }
  .col-sm-5 {
    flex: 0 0 calc(41.666% - var(--rg2));
    max-width: calc(41.666% - var(--rg2));
  }
  .col-sm-6 {
    flex: 0 0 calc(50% - var(--rg2));
    max-width: calc(50% - var(--rg2));
  }
  .col-sm-7 {
    flex: 0 0 calc(58.333% - var(--rg2));
    max-width: calc(58.333% - var(--rg2));
  }
  .col-sm-8 {
    flex: 0 0 calc(66.666% - var(--rg2));
    max-width: calc(66.666% - var(--rg2));
  }
  .col-sm-9 {
    flex: 0 0 calc(75% - var(--rg2));
    max-width: calc(75% - var(--rg2));
  }
  .col-sm-10 {
    flex: 0 0 calc(83.333% - var(--rg2));
    max-width: calc(83.333% - var(--rg2));
  }
  .col-sm-11 {
    flex: 0 0 calc(91.666% - var(--rg2));
    max-width: calc(91.666% - var(--rg2));
  }
  .col-sm-12 {
    flex: 0 0 calc(100% - var(--rg2));
    max-width: calc(100% - var(--rg2));
  }
}

@media (min-width: 768px) {
  .col-md-1 {
    flex: 0 0 calc(8.333% - var(--rg2));
    max-width: calc(8.333% - var(--rg2));
  }
  .col-md-2 {
    flex: 0 0 calc(16.666% - var(--rg2));
    max-width: calc(16.666% - var(--rg2));
  }
  .col-md-3 {
    flex: 0 0 calc(25% - var(--rg2));
    max-width: calc(25% - var(--rg2));
  }
  .col-md-4 {
    flex: 0 0 calc(33.333% - var(--rg2));
    max-width: calc(33.333% - var(--rg2));
  }
  .col-md-5 {
    flex: 0 0 calc(41.666% - var(--rg2));
    max-width: calc(41.666% - var(--rg2));
  }
  .col-md-6 {
    flex: 0 0 calc(50% - var(--rg2));
    max-width: calc(50% - var(--rg2));
  }
  .col-md-7 {
    flex: 0 0 calc(58.333% - var(--rg2));
    max-width: calc(58.333% - var(--rg2));
  }
  .col-md-8 {
    flex: 0 0 calc(66.666% - var(--rg2));
    max-width: calc(66.666% - var(--rg2));
  }
  .col-md-9 {
    flex: 0 0 calc(75% - var(--rg2));
    max-width: calc(75% - var(--rg2));
  }
  .col-md-10 {
    flex: 0 0 calc(83.333% - var(--rg2));
    max-width: calc(83.333% - var(--rg2));
  }
  .col-md-11 {
    flex: 0 0 calc(91.666% - var(--rg2));
    max-width: calc(91.666% - var(--rg2));
  }
  .col-md-12 {
    flex: 0 0 calc(100% - var(--rg2));
    max-width: calc(100% - var(--rg2));
  }
}

@media (min-width: 992px) {
  .col-lg-1 {
    flex: 0 0 calc(8.333% - var(--rg2));
    max-width: calc(8.333% - var(--rg2));
  }
  .col-lg-2 {
    flex: 0 0 calc(16.666% - var(--rg2));
    max-width: calc(16.666% - var(--rg2));
  }
  .col-lg-3 {
    flex: 0 0 calc(25% - var(--rg2));
    max-width: calc(25% - var(--rg2));
  }
  .col-lg-4 {
    flex: 0 0 calc(33.333% - var(--rg2));
    max-width: calc(33.333% - var(--rg2));
  }
  .col-lg-5 {
    flex: 0 0 calc(41.666% - var(--rg2));
    max-width: calc(41.666% - var(--rg2));
  }
  .col-lg-6 {
    flex: 0 0 calc(50% - var(--rg2));
    max-width: calc(50% - var(--rg2));
  }
  .col-lg-7 {
    flex: 0 0 calc(58.333% - var(--rg2));
    max-width: calc(58.333% - var(--rg2));
  }
  .col-lg-8 {
    flex: 0 0 calc(66.666% - var(--rg2));
    max-width: calc(66.666% - var(--rg2));
  }
  .col-lg-9 {
    flex: 0 0 calc(75% - var(--rg2));
    max-width: calc(75% - var(--rg2));
  }
  .col-lg-10 {
    flex: 0 0 calc(83.333% - var(--rg2));
    max-width: calc(83.333% - var(--rg2));
  }
  .col-lg-11 {
    flex: 0 0 calc(91.666% - var(--rg2));
    max-width: calc(91.666% - var(--rg2));
  }
  .col-lg-12 {
    flex: 0 0 calc(100% - var(--rg2));
    max-width: calc(100% - var(--rg2));
  }
}

@media (min-width: 1200px) {
  .col-xl-1 {
    flex: 0 0 calc(8.333% - var(--rg2));
    max-width: calc(8.333% - var(--rg2));
  }
  .col-xl-2 {
    flex: 0 0 calc(16.666% - var(--rg2));
    max-width: calc(16.666% - var(--rg2));
  }
  .col-xl-3 {
    flex: 0 0 calc(25% - var(--rg2));
    max-width: calc(25% - var(--rg2));
  }
  .col-xl-4 {
    flex: 0 0 calc(33.333% - var(--rg2));
    max-width: calc(33.333% - var(--rg2));
  }
  .col-xl-5 {
    flex: 0 0 calc(41.666% - var(--rg2));
    max-width: calc(41.666% - var(--rg2));
  }
  .col-xl-6 {
    flex: 0 0 calc(50% - var(--rg2));
    max-width: calc(50% - var(--rg2));
  }
  .col-xl-7 {
    flex: 0 0 calc(58.333% - var(--rg2));
    max-width: calc(58.333% - var(--rg2));
  }
  .col-xl-8 {
    flex: 0 0 calc(66.666% - var(--rg2));
    max-width: calc(66.666% - var(--rg2));
  }
  .col-xl-9 {
    flex: 0 0 calc(75% - var(--rg2));
    max-width: calc(75% - var(--rg2));
  }
  .col-xl-10 {
    flex: 0 0 calc(83.333% - var(--rg2));
    max-width: calc(83.333% - var(--rg2));
  }
  .col-xl-11 {
    flex: 0 0 calc(91.666% - var(--rg2));
    max-width: calc(91.666% - var(--rg2));
  }
  .col-xl-12 {
    flex: 0 0 calc(100% - var(--rg2));
    max-width: calc(100% - var(--rg2));
  }
}

.hiddenMobile {
  display: none;
}
@media screen and (min-width: 768px) {
  .hiddenMobile {
    display: flex;
  }
}
.visibleTable {
  display: none;
}
@media screen and (min-width: 768px) {
  .visibleTable {
    display: flex;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#root,
input,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, 'Merriweather', serif;
  font-size: 14px;
  text-rendering: optimizeLegibility;
  color: var(--text-primary);
  background: var(--background);
}

body {
  background-attachment: fixed;
}

ul {
  list-style: none;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.text-justify {
  text-align: justify;
}
.text-center {
  text-align: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

code {
  background-color: var(--background-light);
  border: 1px solid var(--border-color);
  font-family: monospace;
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 12px;
}

blockquote {
  position: relative;
  padding: 12px;
  margin: 4px 0;
  border-left: 4px solid var(--border-color);
}

mark {
  color: #fff !important;
  padding: 3px;
  border-radius: 3px;
}

.textblock > div[contenteditable='false'] {
  color: var(--input-txt-disabled);
  background-color: var(--input-bkg-disabled);
}

.textblock code {
  font-family: monospace;
}

.textblock p,
.textblock pre code {
  line-height: 20px;
}

.textblock pre code {
  display: block;
  padding: 8px 12px;
}

.textblock ul,
.textblock ol {
  margin-top: 20px;
  margin-bottom: 20px;
  padding-left: 20px;
}

.textblock ul {
  list-style: disc;
}

.textblock ul[data-type='taskList'] {
  list-style: none;
}
.textblock ul[data-type='taskList'] li {
  display: flex;
  flex-flow: row;
  align-items: center;
  gap: 8px;
}
.textblock ul[data-type='taskList'] li > label > input {
  display: none;
}
.textblock ul[data-type='taskList'] li > label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--input-border-color);
  border-radius: 3px;
  background: var(--input-bkg);
  cursor: pointer;
  color: var(--secondary);
}
.textblock ul[data-type='taskList'] li[data-checked='true'] > label {
  border-color: transparent;
  background: var(--btn-bkg);
}
.textblock ul[data-type='taskList'] li[data-checked='true'] > label > span {
  width: 100%;
  height: 100%;
  mask-position: center;
  mask-size: contain;
  background: var(--text-secondary);
  mask-image: url(https://cdn.grenalthia.com/accessh/icons/check.svg);
}
.textblock ul[data-type='taskList'] li[data-checked='true'] {
  text-decoration: line-through;
}

.textblock hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

.textblock .mention {
  padding: 2px 4px;
  border-radius: 2px;
  text-decoration: none;
  box-decoration-break: clone;
  color: var(--mention);
  background-color: var(--mention-bg);
  cursor: pointer;

  &:hover {
    background-color: var(--mention-hover-bg);
  }
}

.flex {
  display: flex;
}
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.flex-vcenter {
  display: flex;
  align-items: center;
}
.flex-hcenter {
  display: flex;
  justify-content: center;
}
.flex-between {
  display: flex;
  justify-content: space-between;
}
.flex-end {
  display: flex;
  justify-content: flex-end;
}
.flex-column {
  display: flex;
  flex-direction: column;
}
.flex-row {
  display: flex;
  flex-direction: row;
}
.align-start {
  align-items: flex-start;
}
.align-center {
  align-items: center;
}
.align-end {
  align-items: flex-end;
}
.flex-spacer {
  flex: 1;
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}

.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-5 {
  margin-top: 20px;
}
.mt-auto {
  margin-top: auto;
}
.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 16px;
}
.mb-5 {
  margin-bottom: 20px;
}
.mb-auto {
  margin-bottom: auto;
}
.ml-1 {
  margin-left: 4px;
}
.ml-2 {
  margin-left: 8px;
}
.ml-3 {
  margin-left: 12px;
}
.ml-4 {
  margin-left: 16px;
}
.ml-5 {
  margin-left: 20px;
}
.ml-auto {
  margin-left: auto;
}
.mr-1 {
  margin-right: 4px;
}
.mr-2 {
  margin-right: 8px;
}
.mr-3 {
  margin-right: 12px;
}
.mr-4 {
  margin-right: 16px;
}
.mr-5 {
  margin-right: 20px;
}
.mr-auto {
  margin-right: auto;
}
.mx-1 {
  margin-left: 4px;
  margin-right: 4px;
}
.mx-2 {
  margin-left: 8px;
  margin-right: 8px;
}
.mx-3 {
  margin-left: 12px;
  margin-right: 12px;
}
.mx-4 {
  margin-left: 16px;
  margin-right: 16px;
}
.mx-5 {
  margin-left: 20px;
  margin-right: 20px;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.my-1 {
  margin-top: 4px;
  margin-bottom: 4px;
}
.my-2 {
  margin-top: 8px;
  margin-bottom: 8px;
}
.my-3 {
  margin-top: 12px;
  margin-bottom: 12px;
}
.my-4 {
  margin-top: 16px;
  margin-bottom: 16px;
}
.my-5 {
  margin-top: 20px;
  margin-bottom: 20px;
}
.my-auto {
  margin-top: auto;
  margin-bottom: auto;
}
.ma-1 {
  margin: 4px;
}
.ma-2 {
  margin: 8px;
}
.ma-3 {
  margin: 12px;
}
.ma-4 {
  margin: 16px;
}
.ma-5 {
  margin: 20px;
}
.ma-auto {
  margin: auto;
}
.pt-1 {
  padding-top: 4px;
}
.pt-2 {
  padding-top: 8px;
}
.pt-3 {
  padding-top: 12px;
}
.pt-4 {
  padding-top: 16px;
}
.pt-5 {
  padding-top: 20px;
}
.pb-1 {
  padding-bottom: 4px;
}
.pb-2 {
  padding-bottom: 8px;
}
.pb-3 {
  padding-bottom: 12px;
}
.pb-4 {
  padding-bottom: 16px;
}
.pb-5 {
  padding-bottom: 20px;
}
.pl-1 {
  padding-left: 4px;
}
.pl-2 {
  padding-left: 8px;
}
.pl-3 {
  padding-left: 12px;
}
.pl-4 {
  padding-left: 16px;
}
.pl-5 {
  padding-left: 20px;
}
.pr-1 {
  padding-right: 4px;
}
.pr-2 {
  padding-right: 8px;
}
.pr-3 {
  padding-right: 12px;
}
.pr-4 {
  padding-right: 16px;
}
.pr-5 {
  padding-right: 20px;
}
.px-1 {
  padding-left: 4px;
  padding-right: 4px;
}
.px-2 {
  padding-left: 8px;
  padding-right: 8px;
}
.px-3 {
  padding-left: 12px;
  padding-right: 12px;
}
.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}
.px-5 {
  padding-left: 20px;
  padding-right: 20px;
}
.py-1 {
  padding-top: 4px;
  padding-bottom: 4px;
}
.py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}
.py-3 {
  padding-top: 12px;
  padding-bottom: 12px;
}
.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}
.py-5 {
  padding-top: 20px;
  padding-bottom: 20px;
}
.pa-1 {
  padding: 4px;
}
.pa-2 {
  padding: 8px;
}
.pa-3 {
  padding: 12px;
}
.pa-4 {
  padding: 16px;
}
.pa-5 {
  padding: 20px;
}
.g-1 {
  gap: 4px;
}
.g-2 {
  gap: 8px;
}
.g-3 {
  gap: 12px;
}
.g-4 {
  gap: 16px;
}
.g-5 {
  gap: 20px;
}

.overflow-hidden {
  overflow: hidden;
}
.overflow-auto {
  overflow: auto;
}

img {
  position: relative;
}

img::before {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
}

input,
textarea {
  height: 36px;
  padding: 8px 12px;
  color: var(--input-txt);
  background-color: var(--input-bkg);
  border: none;
  border-radius: var(--border-radius);
}

input:focus,
textarea:focus {
  outline: var(--focus-outline-width) solid var(--focus-outline-color);
}
