/* Editor de texto con formato y contenido formateado (src/js/rich-text.js).
   Lo usan contratos y presupuestos. Solo tokens de design-tokens.css. */
.rt { border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--card); overflow: hidden; }
.rt:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 20%, transparent); }
.rt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); background: var(--muted); position: sticky; top: 0; z-index: 1; }
#app-layout .rt-btn {
  min-width: 30px; height: 30px; padding: 0 0.5rem; border: 0; border-radius: 6px; background: transparent; box-shadow: none;
  font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); line-height: 1;
}
#app-layout .rt-btn:hover { background: var(--card); color: var(--foreground); }
#app-layout .rt-btn[aria-pressed="true"] { background: var(--card); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); }
#app-layout .rt-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.rt-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--border); }
.rt-area { position: relative; min-height: 320px; max-height: 55vh; overflow-y: auto; padding: 1rem 1.25rem; outline: none; color: var(--foreground); font-size: 0.875rem; line-height: 1.65; }
.rt-area.is-empty::before { content: attr(data-placeholder); color: var(--muted-foreground); pointer-events: none; position: absolute; }

/* Contenido con formato: editor, ficha del contrato */
.rt-area, .rt-content, .ctr-rich { overflow-wrap: anywhere; }
:is(.rt-area, .rt-content, .ctr-rich) > * + * { margin-top: 0.625rem; }
:is(.rt-area, .rt-content, .ctr-rich) h2 { font-size: 1.0625rem; font-weight: 600; color: var(--foreground); margin-top: 1.25rem; }
:is(.rt-area, .rt-content, .ctr-rich) h3 { font-size: 0.9375rem; font-weight: 600; color: var(--foreground); margin-top: 1rem; }
:is(.rt-area, .rt-content, .ctr-rich) > :first-child { margin-top: 0; }
:is(.rt-area, .rt-content, .ctr-rich) ul { list-style: disc; padding-left: 1.25rem; }
:is(.rt-area, .rt-content, .ctr-rich) ol { list-style: decimal; padding-left: 1.25rem; }
:is(.rt-area, .rt-content, .ctr-rich) li + li { margin-top: 0.25rem; }
:is(.rt-area, .rt-content, .ctr-rich) strong { font-weight: 600; color: var(--foreground); }
:is(.rt-area, .rt-content, .ctr-rich) blockquote { border-left: 2px solid var(--border); padding-left: 0.875rem; color: var(--muted-foreground); }
.rt-content, .ctr-rich { font-size: 0.875rem; line-height: 1.65; color: var(--foreground); }
@media (max-width: 640px) {
  .rt-area { min-height: 240px; padding: 0.875rem 1rem; }
}
