.note-editor {
  display: flex;
  flex-direction: column;
  border: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.note-editor .lexxy-editor__content > :last-child {
  margin-block-end: 0;
}

.note-editor .lexxy-editor__content {
  order: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  min-height: 1.5rem;
  max-height: 10rem;
  overflow-y: auto;
}

.note-composer-form--call .note-editor .lexxy-editor__content {
  padding: 0.25rem 0 0.5rem;
  min-height: 4.5rem;
}

.note-editor lexxy-toolbar {
  order: 2;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0.25rem 3rem 0 0;
}

.note-edit-card lexxy-toolbar {
  margin-right: 9.5rem;
}

.note-editor lexxy-toolbar button {
  background: transparent;
  border: none;
  box-shadow: none;
  block-size: 2rem;
}

.note-editor lexxy-toolbar button:hover {
  background: var(--note-toolbar-hover, rgb(254 243 199));
}

.note-editor lexxy-toolbar :is(
  button[name="image"],
  button[name="file"],
  button[name="underline"],
  lexxy-toolbar-dropdown:has(button[name="format"]),
  lexxy-link-dropdown,
  button[name="code"],
  button[name="table"],
  button[name="divider"],
  button[name="undo"],
  button[name="redo"],
  .lexxy-editor__toolbar-overflow
) {
  display: none;
}

#opportunity-activity .note-reference-chip {
  display: none;
}

/* Dark theme: map the editor's variables to app tokens. Set on the themed element
   (not :root) so the derived Lexxy values below resolve against the dark tokens. */
[data-theme="dark"] {
  --lexxy-color-ink: var(--foreground);
  --lexxy-color-ink-medium: var(--muted-foreground);
  --lexxy-color-ink-light: var(--subtle-foreground);
  --lexxy-color-ink-lighter: var(--border);
  --lexxy-color-ink-lightest: var(--muted);
  --lexxy-color-ink-inverted: var(--background);

  --lexxy-color-accent-dark: var(--link);
  --lexxy-color-accent-medium: var(--link);
  --lexxy-color-accent-light: color-mix(in oklab, var(--link) 30%, var(--card));
  --lexxy-color-accent-lightest: color-mix(in oklab, var(--link) 18%, var(--card));
  --lexxy-color-blue: var(--link);

  --lexxy-color-canvas: var(--card);
  --lexxy-color-text: var(--foreground);
  --lexxy-color-text-subtle: var(--muted-foreground);
  --lexxy-color-link: var(--link);
  --lexxy-color-selected: var(--lexxy-color-accent-lightest);
  --lexxy-color-selected-hover: var(--lexxy-color-accent-light);
  --lexxy-color-selected-dark: var(--link);
  --lexxy-color-selected-50: color-mix(in oklch, var(--link) 50%, transparent);
  --lexxy-color-code-bg: var(--muted);
  --lexxy-color-floating-controls-separator: var(--border);
  --lexxy-focus-ring-color: var(--link);

  --lexxy-color-table-header-bg: var(--muted);
  --lexxy-color-table-cell-border: var(--border);
  --lexxy-color-table-cell-selected: var(--lexxy-color-accent-lightest);
  --lexxy-color-table-cell-selected-border: var(--link);
  --lexxy-color-table-cell-selected-bg: var(--lexxy-color-accent-lightest);
  --lexxy-color-table-cell-add: var(--lexxy-color-selected-50);
  --lexxy-color-table-cell-toggle: var(--lexxy-color-accent-lightest);

  --lexxy-color-code-token-att: #ff7b72;
  --lexxy-color-code-token-comment: #8b949e;
  --lexxy-color-code-token-function: #d2a8ff;
  --lexxy-color-code-token-operator: #ff7b72;
  --lexxy-color-code-token-property: #79c0ff;
  --lexxy-color-code-token-punctuation: var(--foreground);
  --lexxy-color-code-token-selector: #7ee787;
  --lexxy-color-code-token-variable: #ffa657;

  --highlight-1: rgb(229 211 91);
  --highlight-2: rgb(255 163 72);
  --highlight-3: rgb(255 123 114);
  --highlight-4: rgb(255 130 214);
  --highlight-5: rgb(196 150 255);
  --highlight-6: rgb(110 178 255);
  --highlight-7: rgb(103 214 98);
  --highlight-8: rgb(214 160 110);
  --highlight-9: rgb(190 190 190);

  --note-toolbar-hover: var(--accent);

  --rt-surface: var(--card);
  --rt-line: var(--border);
  --rt-line-soft: var(--border);
  --rt-line-strong: var(--edge);
  --rt-hover: var(--accent);
  --rt-selected-bg: color-mix(in oklab, var(--link) 18%, var(--card));
  --rt-accent: var(--primary);
  --rt-accent-hover: color-mix(in oklab, var(--primary) 85%, var(--foreground));
  --rt-accent-fg: var(--primary-foreground);
  --rt-text: var(--foreground);
  --rt-text-body: var(--foreground);
  --rt-text-muted: var(--muted-foreground);
  --rt-text-subtle: var(--subtle-foreground);
  --rt-pill-fg: var(--link);
  --rt-pill-bg: color-mix(in oklab, var(--link) 18%, var(--card));
  --rt-add-fg: var(--success-700);
  --rt-del-fg: var(--danger-700);
  --rt-diff-ins-bg: var(--success-100);
  --rt-diff-del-bg: var(--danger-100);
  --rt-diff-block-edge: var(--edge);
  --rt-diff-added-edge: var(--success-500);
  --rt-diff-added-bg: var(--success-50);
  --rt-diff-removed-edge: var(--danger-500);
  --rt-diff-removed-bg: var(--danger-50);
  --rt-toast-bg: var(--popover);
  --rt-toast-fg: var(--popover-foreground);
}
