/* Описание задачи с форматированием: панель и поле contenteditable. */

.editor { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); margin-top: 8px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.editor:hover { border-color: var(--dim); }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.editor .tools { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.editor .tools button { width: 30px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--dim); }
.editor .tools button:hover { background: var(--press); color: var(--ink); }
.editor .tools button[aria-pressed='true'] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.editor .tools .ic { width: 16px; height: 16px; }

.editor .text { min-height: 92px; padding: 10px 14px 12px; font-size: 15.5px; line-height: 1.5; outline: none; overflow-wrap: anywhere; }
.editor .text:empty::before { content: attr(data-placeholder); color: var(--dim); pointer-events: none; }
.editor .text > :first-child { margin-top: 0; }
.editor .text > :last-child { margin-bottom: 0; }
.editor .text p { margin: 0 0 .5em; }
.editor .text h2 { margin: .7em 0 .3em; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.editor .text h3 { margin: .7em 0 .25em; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.editor .text ul, .editor .text ol { margin: 0 0 .5em; padding-left: 1.4em; }
.editor .text li { margin: .15em 0; }
.editor .text blockquote { margin: .4em 0; padding: 2px 12px; border-left: 3px solid var(--line); color: var(--dim); }
.editor .text code, .editor .text pre { font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: .92em; background: var(--press); border-radius: 4px; padding: 1px 4px; }
.editor .text pre { padding: 8px 10px; overflow-x: auto; }
.editor .text ::selection { background: var(--accent); color: var(--bg); }
