.ap-rich-text-editor {
  display: inline-grid;
}

.ap-rich-text-editor .editor-container {
  min-width: 364px;
  min-height: 184px;
  color: var(--color-foreground-de-emp);
  border: 1px solid var(--color-foreground-de-emp);
  margin-top: var(--pad-l);
  margin-bottom: var(--pad-xs);
  resize: vertical;
  font-family: var(--font-m-family);
  border-radius: 3px;
  flex-direction: column;
  display: flex;
  position: relative;
  overflow: auto;
}

.ap-rich-text-editor .editor-container:focus-within {
  outline: 2px solid var(--color-focus-indicator);
  outline-offset: -1px;
}

.ap-rich-text-editor .editor-container.error {
  border: 1px solid var(--color-error-text);
  outline: 1px solid var(--color-error-text);
}

.ap-rich-text-editor .editor-container.error:focus-within {
  outline: 2px solid var(--color-error-text);
  outline-offset: -1px;
}

.ap-rich-text-editor .editor-container.disabled {
  border: 1px solid var(--color-border-disabled);
  cursor: not-allowed;
}

.ap-rich-text-editor .editor-container.loading {
  cursor: wait;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  gap: 45px;
  display: flex;
}

.ap-rich-text-editor .editor-label {
  color: var(--color-foreground-de-emp);
  font-size: var(--font-m-size);
  font-weight: 600;
  line-height: var(--font-m-line-height);
  font-family: var(--font-m-family);
}

.ap-rich-text-editor .editor-label.disabled {
  color: var(--color-foreground-disable);
}

.ap-rich-text-editor .editor-inner {
  resize: vertical;
  border: 0;
  border-radius: 3px;
  flex-direction: column;
  flex: 1;
  display: flex;
  position: relative;
  overflow: auto;
}

.ap-rich-text-editor .editor-inner.disabled * {
  color: var(--color-foreground-disable) !important;
}

.ap-rich-text-editor .editor-input {
  resize: none;
  font-size: var(--font-m-size);
  line-height: var(--font-m-line-height);
  tab-size: 1;
  padding: var(--pad-xxl) var(--pad-xxxl);
  outline: 0;
  position: relative;
}

.ap-rich-text-editor .editor-placeholder {
  color: var(--color-foreground-light);
  text-overflow: ellipsis;
  top: var(--pad-xxl);
  left: var(--pad-xxxl);
  font-size: var(--font-m-size);
  line-height: var(--font-m-line-height);
  user-select: none;
  pointer-events: none;
  display: inline-block;
  position: absolute;
  overflow: hidden;
}

.ap-rich-text-editor .editor-text-bold:before, .ap-rich-text-editor .editor-text-italic:before, .ap-rich-text-editor .editor-text-underline:before, .ap-rich-text-editor .editor-text-strikethrough:before, .ap-rich-text-editor .editor-text-underlineStrikethrough:before {
  clip: rect(0, 0, 0, 0);
  position: absolute;
}

.ap-rich-text-editor .editor-text-bold {
  font-weight: bold;
}

.ap-rich-text-editor .editor-text-bold:before {
  content: "bold";
}

.ap-rich-text-editor .editor-text-bold.editor-text-italic:before {
  content: "bold italic";
}

.ap-rich-text-editor .editor-text-bold.editor-text-italic.editor-text-underline:before {
  content: "bold italic underline";
}

.ap-rich-text-editor .editor-text-bold.editor-text-italic.editor-text-strikethrough:before {
  content: "bold italic strikethrough";
}

.ap-rich-text-editor .editor-text-bold.editor-text-italic.editor-text-underlineStrikethrough:before {
  content: "bold italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-bold.editor-text-underline:before {
  content: "bold underline";
}

.ap-rich-text-editor .editor-text-bold.editor-text-underline.editor-text-italic:before {
  content: "bold italic underline";
}

.ap-rich-text-editor .editor-text-bold.editor-text-strikethrough:before {
  content: "bold strikethrough";
}

.ap-rich-text-editor .editor-text-bold.editor-text-strikethrough.editor-text-italic:before {
  content: "bold italic strikethrough";
}

.ap-rich-text-editor .editor-text-bold.editor-text-underlineStrikethrough:before {
  content: "bold underline strikethrough";
}

.ap-rich-text-editor .editor-text-bold.editor-text-underlineStrikethrough.editor-text-italic:before {
  content: "bold italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-italic {
  font-style: italic;
}

.ap-rich-text-editor .editor-text-italic:before {
  content: "italic";
}

.ap-rich-text-editor .editor-text-italic.editor-text-bold:before {
  content: "bold italic";
}

.ap-rich-text-editor .editor-text-italic.editor-text-bold.editor-text-underline:before {
  content: "bold italic underline";
}

.ap-rich-text-editor .editor-text-italic.editor-text-bold.editor-text-strikethrough:before {
  content: "bold italic strikethrough";
}

.ap-rich-text-editor .editor-text-italic.editor-text-bold.editor-text-underlineStrikethrough:before {
  content: "bold italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-italic.editor-text-underline:before {
  content: "italic underline";
}

.ap-rich-text-editor .editor-text-italic.editor-text-underline.editor-text-bold:before {
  content: "bold italic underline";
}

.ap-rich-text-editor .editor-text-italic.editor-text-strikethrough:before {
  content: "italic strikethrough";
}

.ap-rich-text-editor .editor-text-italic.editor-text-strikethrough.editor-text-bold:before {
  content: "bold italic strikethrough";
}

.ap-rich-text-editor .editor-text-italic.editor-text-underlineStrikethrough:before {
  content: "italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-italic.editor-text-underlineStrikethrough.editor-text-bold:before {
  content: "bold italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-underline {
  text-decoration: underline;
}

.ap-rich-text-editor .editor-text-underline:before {
  content: "underline";
}

.ap-rich-text-editor .editor-text-underline.editor-text-bold:before {
  content: "bold underline";
}

.ap-rich-text-editor .editor-text-underline.editor-text-bold.editor-text-italic:before {
  content: "bold italic underline";
}

.ap-rich-text-editor .editor-text-underline.editor-text-italic:before {
  content: "italic underline";
}

.ap-rich-text-editor .editor-text-underline.editor-text-italic.editor-text-bold:before {
  content: "bold italic underline";
}

.ap-rich-text-editor .editor-text-strikethrough {
  text-decoration: line-through;
}

.ap-rich-text-editor .editor-text-strikethrough:before {
  content: "strikethrough";
}

.ap-rich-text-editor .editor-text-strikethrough.editor-text-bold:before {
  content: "bold strikethrough";
}

.ap-rich-text-editor .editor-text-strikethrough.editor-text-bold.editor-text-italic:before {
  content: "bold italic strikethrough";
}

.ap-rich-text-editor .editor-text-strikethrough.editor-text-italic:before {
  content: "italic strikethrough";
}

.ap-rich-text-editor .editor-text-strikethrough.editor-text-italic.editor-text-bold:before {
  content: "bold italic strikethrough";
}

.ap-rich-text-editor .editor-text-underlineStrikethrough {
  text-decoration: underline line-through;
}

.ap-rich-text-editor .editor-text-underlineStrikethrough:before {
  content: "underline strikethrough";
}

.ap-rich-text-editor .editor-text-underlineStrikethrough.editor-text-bold:before {
  content: "bold underline strikethrough";
}

.ap-rich-text-editor .editor-text-underlineStrikethrough.editor-text-bold.editor-text-italic:before {
  content: "bold italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-underlineStrikethrough.editor-text-italic:before {
  content: "italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-underlineStrikethrough.editor-text-italic.editor-text-bold:before {
  content: "bold italic underline strikethrough";
}

.ap-rich-text-editor .editor-text-code {
  background-color: var(--color-background-secondary);
  border-radius: 3px;
  padding: 1px .25rem;
  font-family: Menlo, Consolas, Monaco, monospace;
  font-size: 94%;
}

.ap-rich-text-editor .editor-link {
  color: var(--color-foreground-link);
  text-decoration: none;
}

.ap-rich-text-editor .editor-code {
  background-color: var(--color-background-secondary);
  padding: var(--pad-l) var(--pad-l) var(--pad-l) 52px;
  margin: 0;
  margin-top: var(--pad-l);
  tab-size: 2;
  white-space: pre;
  border-radius: 3px;
  margin-bottom: 8px;
  font-family: Menlo, Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.53;
  display: block;
  position: relative;
  overflow: auto hidden;
}

.ap-rich-text-editor .editor-code:before {
  content: attr(data-gutter);
  background-color: var(--color-background-gray);
  border-right: 1px solid var(--color-border);
  padding: var(--pad-l);
  color: var(--color-foreground);
  white-space: pre-wrap;
  text-align: right;
  min-width: 24px;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.ap-rich-text-editor .editor-tokenComment {
  color: #708090;
}

.ap-rich-text-editor .editor-tokenPunctuation {
  color: #999;
}

.ap-rich-text-editor .editor-tokenProperty {
  color: #905;
}

.ap-rich-text-editor .editor-tokenSelector {
  color: #690;
}

.ap-rich-text-editor .editor-tokenOperator {
  color: #9a6e3a;
}

.ap-rich-text-editor .editor-tokenAttr {
  color: #07a;
}

.ap-rich-text-editor .editor-tokenVariable {
  color: #e90;
}

.ap-rich-text-editor .editor-tokenFunction {
  color: #dd4a68;
}

.ap-rich-text-editor .editor-paragraph {
  margin: 0 0 8px;
  position: relative;
}

.ap-rich-text-editor .editor-paragraph:last-child {
  margin-bottom: 0;
}

.ap-rich-text-editor .editor-heading-h1 {
  font-size: var(--font-header-1-size);
  line-height: var(--font-header-1-line-height);
  color: var(--color-foreground);
  margin: 0;
  padding: 0;
}

.ap-rich-text-editor .editor-heading-h2 {
  font-size: var(--font-header-2-size);
  line-height: var(--font-header-2-line-height);
  color: var(--color-foreground-de-emp);
  margin: 0;
  padding: 0;
}

.ap-rich-text-editor .editor-heading-h3 {
  font-size: var(--font-header-3-size);
  line-height: var(--font-header-3-line-height);
  color: var(--color-foreground-de-emp);
  margin: 0;
  padding: 0;
}

.ap-rich-text-editor .editor-heading-h4, .ap-rich-text-editor .editor-heading-h5 {
  font-size: var(--font-header-4-size);
  line-height: var(--font-header-4-line-height);
  color: var(--color-foreground-de-emp);
  margin: 0;
  padding: 0;
}

.ap-rich-text-editor .editor-quote {
  font-size: var(--font-m-size);
  color: var(--color-foreground-de-emp);
  border-left-color: var(--color-background-gray-emp);
  padding-left: var(--pad-xxxl);
  border-left-style: solid;
  border-left-width: 4px;
  margin: 0 0 0 20px;
}

.ap-rich-text-editor .editor-list-ol, .ap-rich-text-editor .editor-list-ul {
  margin: 0;
  margin-left: var(--pad-xxxl);
  padding: 0;
}

.ap-rich-text-editor .editor-listitem {
  margin: var(--pad-l) calc(var(--pad-xxxl) * 2);
}

.ap-rich-text-editor .editor-nested-listitem {
  list-style-type: none;
}

.ap-rich-text-editor pre::-webkit-scrollbar {
  background: none;
  width: 10px;
}

.ap-rich-text-editor pre::-webkit-scrollbar-thumb {
  background: var(--color-background-gray);
}

.ap-rich-text-editor .toolbar {
  padding: var(--pad-m) var(--pad-l);
  border-bottom: 1px solid var(--color-foreground-de-emp);
  background: none;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  align-items: center;
  margin-bottom: 1px;
  display: flex;
}

.ap-rich-text-editor .toolbar.disabled {
  border-bottom: 1px solid var(--color-border-disabled);
}

.ap-rich-text-editor .toolbar button.toolbar-item {
  cursor: pointer;
  vertical-align: middle;
  color: var(--color-icon-default);
  background: none;
  border: 0;
  border-radius: 3px;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
}

.ap-rich-text-editor .toolbar button.toolbar-item:disabled {
  cursor: not-allowed;
  color: var(--color-foreground-disable);
}

.ap-rich-text-editor .toolbar button.toolbar-item.spaced {
  margin-right: var(--pad-xxl);
}

.ap-rich-text-editor .toolbar button.toolbar-item.active {
  color: var(--color-foreground-inverse);
  background-color: var(--color-background-inverse);
}

.ap-rich-text-editor .toolbar .toolbar-item:hover:not([disabled]):not(.active) {
  color: var(--color-foreground);
  background-color: var(--color-background-hover);
}

.ap-rich-text-editor .toolbar .divider {
  background-color: var(--color-background-gray);
  width: 1px;
  margin-right: var(--pad-xxl);
  height: 24px;
}

.ap-rich-text-editor .editor-table {
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  width: max-content;
  margin: 32px 0;
  overflow: scroll;
}

.ap-rich-text-editor .editor-table-selection ::selection {
  background-color: #0000;
}

.ap-rich-text-editor .editor-table-selected {
  outline: 2px solid var(--color-focus-indicator);
}

.ap-rich-text-editor .editor-table-cell {
  border: 1px solid var(--color-border);
  vertical-align: top;
  text-align: start;
  outline: none;
  width: 72px;
  min-width: 72px;
  padding: 6px 8px;
  position: relative;
}

.ap-rich-text-editor .editor-table-cell-header {
  background-color: var(--color-background-gray);
  text-align: start;
  color: var(--color-foreground);
}

.ap-rich-text-editor .editor-table-cell-selected {
  background-color: var(--color-background-pressed);
}

.ap-rich-text-editor .editor-table-cell-primary-selected {
  border: 2px solid var(--color-focus-indicator);
  z-index: 2;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  display: block;
  position: absolute;
  top: -1px;
  left: -1px;
}

.ap-rich-text-editor .editor-table-cell-editing {
  border-radius: 3px;
  box-shadow: 0 0 5px #0006;
}

