/* The formatting of a long text (src/views/richText.ts, public/js/richtext.js; the same in INTECHI CRM and INTECHI SMART): the bar of
   small icon buttons over the field, the editable box that looks like the field, and a formatted text shown on a page. */
html.sd .rt-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
html.sd .rt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
html.sd .rt-bar[hidden],
html.sd .rt-colors[hidden] {
  display: none;
}
html.sd .rt-b[aria-pressed='true'] {
  background: var(--sd-action-blue-bg);
  border-color: var(--sd-action-blue-line);
  color: var(--sd-action-blue-ink);
}
/* the colours of the palette: round swatches in a row under the bar */
html.sd .rt-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-basis: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
html.sd .rt-color {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--card);
  border-radius: 50%;
  outline: 1px solid var(--line);
  background: var(--rt-c);
  cursor: pointer;
}
html.sd .rt-color:focus-visible {
  outline: 3px solid var(--accent);
}
html.sd .rt-color-none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
/* the box looks as the field it replaces */
html.sd .rt-area {
  box-sizing: border-box;
  width: 100%;
  max-height: 60vh;
  overflow: auto;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--sd-field-line, #cbd5e1);
  border-radius: var(--sd-field-r, 6px);
  background-color: var(--card);
  color: var(--text);
  /* the label around it may be bold: the text of the box is normal, so Bold makes it bold */
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
html.sd .rt-area:focus-visible {
  outline: 0;
  border-color: var(--sd-color-primary-700);
  box-shadow: inset 0 0 0 1px var(--sd-color-primary-700);
}
html.sd .rt-area.rt-invalid {
  border-color: #b91c1c;
}
html.sd[data-theme='dark'] .rt-area {
  border-color: #334155;
}
html.sd .rt-area p,
html.sd .rt-show p {
  margin: 0;
}
html.sd .rt-area ul,
html.sd .rt-area ol,
html.sd .rt-show ul,
html.sd .rt-show ol {
  margin: 0;
  padding-left: 1.4em;
}
html.sd .rt-area a,
html.sd .rt-show a {
  color: var(--brand, #2f86ee);
  text-decoration: underline;
}
html.sd .rt-show {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* the colours of the palette are stored for a white e-mail; in the dark mode the page shows their light tones (contrast at least 4.5:1) */
html.sd[data-theme='dark'] :is(.rt-area, .rt-show) [style*='#1b6ada'] {
  color: #93c5fd !important;
}
html.sd[data-theme='dark'] :is(.rt-area, .rt-show) [style*='#15803d'] {
  color: #86efac !important;
}
html.sd[data-theme='dark'] :is(.rt-area, .rt-show) [style*='#c2410c'] {
  color: #fdba74 !important;
}
html.sd[data-theme='dark'] :is(.rt-area, .rt-show) [style*='#b91c1c'] {
  color: #fca5a5 !important;
}
html.sd[data-theme='dark'] :is(.rt-area, .rt-show) [style*='#7e22ce'] {
  color: #d8b4fe !important;
}
html.sd[data-theme='dark'] :is(.rt-area, .rt-show) [style*='#475569'] {
  color: #cbd5e1 !important;
}
/* a finger: every button at least 44 px */
@media (pointer: coarse), (max-width: 640px) {
  html.sd .rt-b {
    min-width: 44px;
    min-height: 44px;
  }
  html.sd .rt-color {
    width: 44px;
    height: 44px;
  }
}
