/* ==========================================================================
   RICH-TEXT NOTES (src/components/crm/RichNotes.tsx), from the design's
   components/rich-notes.css (Meetings spec, Spec 2), on the app's tokens.
   Toolbar 36px, bottom border, 6px 6px 0 0 radius.
   Buttons: normal (muted, transparent) / hover (text, tint, 4px radius) /
   active (brand, brand tint, 600).
   ========================================================================== */
.rn { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.rn:focus-within { border-color: var(--border-strong, var(--brand)); }
.rn__bar { display: flex; align-items: center; gap: 2px; height: 36px; padding: 0 6px; border-bottom: 1px solid var(--border); border-radius: 6px 6px 0 0; background: var(--surface-2); }
.rn__btn { position: relative; display: inline-grid; place-items: center; width: 28px; height: 26px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; transition: background .12s, color .12s; }
.rn__btn b { font-weight: 700; }
.rn__btn i { font-family: Georgia, serif; font-style: italic; }
.rn__btn svg { width: 15px; height: 15px; }
.rn__btn:hover { background: var(--border); color: var(--text); }
.rn__btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.rn__btn.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
/* tooltip (the design's dark chip: the panel tokens stay dark in both themes) */
.rn__btn::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; z-index: 5; padding: 4px 8px; border-radius: 4px; background: var(--panel); color: var(--panel-text); font-family: inherit; font-size: 11.5px; font-style: normal; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(-50%); transition: opacity .12s .25s; }
.rn__btn:hover::after, .rn__btn:focus-visible::after { opacity: 1; }

.rn__area { flex: 1; min-height: 110px; padding: 10px 12px; color: var(--text); font-size: 13px; line-height: 1.55; outline: 0; overflow-wrap: anywhere; }
.rn__area.is-empty::before { content: attr(data-placeholder); color: var(--text-subtle, var(--text-muted)); pointer-events: none; }
.rn__area ul, .rn__area ol { margin: 4px 0; padding-left: 22px; }
.rn__area ul { list-style: disc; }
.rn__area ol { list-style: decimal; }
.rn__area li { display: list-item; }
.rn__area a { color: var(--brand); text-decoration: underline; }
.rn__area p, .rn__area div { margin: 0; }

.rn__link { position: absolute; top: 40px; left: 6px; z-index: 20; display: flex; flex-direction: column; gap: 8px; width: min(300px, calc(100% - 12px)); padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-lg); }
.rn__link[hidden] { display: none; }
.rn__link-row { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.rn__link-row input { height: 32px; padding: 0 8px; border: 1px solid var(--border-strong, var(--border)); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 400; }
.rn__link-row input:focus { border-color: var(--brand); outline: 0; }
.rn__link-row input[aria-invalid="true"] { border-color: var(--danger); }
.rn__link-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.rn__lbtn { height: 30px; padding: 0 10px; border: 1px solid var(--border-strong, var(--border)); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.rn__lbtn:hover { background: var(--surface-hover, var(--surface-2)); }
.rn__lbtn--primary { border-color: var(--brand); background: var(--brand); color: var(--brand-contrast); }
.rn__lbtn--primary:hover { background: var(--brand); filter: brightness(.92); }
@media (prefers-reduced-motion: reduce) { .rn__btn, .rn__btn::after { transition: none; } }
