/* Telegram message editor: no remote fonts or resources. */
#dialog:has(.rich-editor){width: min(850px,calc(100vw - 32px));max-width:850px;max-height:calc(100svh - 32px)}
#dialog:has(.rich-editor) #dialog-body>.hint{font-size:14px;margin-bottom:16px}
.rich-editor{border:1px solid #cdd0c5;border-radius:18px;overflow:hidden;background:#fff}
.rich-editor:focus-within{border-color:#9ba281;box-shadow:0 0 0 3px #e9eddd}
.text-toolbar{display:flex;flex-wrap:wrap;gap:5px;padding:10px;background:#f2f3ec;border-bottom:1px solid #dde0d3}
.text-tool{min-width:42px;height:42px;padding:7px;border:1px solid transparent;border-radius:9px;background:transparent;color:#292d25;font-family:inherit;font-size:20px;font-weight:600;line-height:1;cursor:pointer;display:grid;place-items:center}
.text-tool:hover{background:#e4e8d5}.text-tool[aria-pressed=true]{background:#282d23;color:#fff;border-color:#282d23}.text-tool:disabled{opacity:.35;cursor:default}
.text-tool:focus-visible{outline:2px solid #7581cf;outline-offset:1px}
.tool-bold{font-weight:800}.tool-italic{font-style:italic}.tool-underline{text-decoration:underline}.tool-strike{text-decoration:line-through}.text-tool.tool-word{font-size:13px;padding-inline:12px}
.telegram-composer{padding:20px;min-height:270px;max-height:43svh;overflow:auto;outline:none;font-size:17px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;tab-size:4}
.telegram-composer p{margin:0;min-height:1.6em}.telegram-composer pre{white-space:pre-wrap}.telegram-composer li{position:relative}
.telegram-composer .ProseMirror-selectednode{outline:2px solid #8ab4f8}.telegram-composer .ProseMirror-separator{display:inline;border:none!important;margin:0!important;width:0!important;height:0!important}
.telegram-composer a{color:#176c9d;text-decoration:underline;cursor:text}
.text-count{padding:7px 16px;background:#fff;color:#7b8172;text-align:right;font-size:12px;border-top:1px solid #f0f1eb}.text-count.over-limit{color:#b43b2f;font-weight:700}
.text-editor-error{margin:0;padding:10px 16px;background:#fff1eb;color:#a32e21;font-size:14px;line-height:1.4}
.text-link-panel{padding:14px;display:grid;gap:10px;background:#f9faf6;border-bottom:1px solid #d9ddce}
.text-link-panel label{font-size:13px;display:grid;gap:5px}.text-link-panel input{width:100%;min-height:42px;font-size:16px;border-radius:9px;border:1px solid #cfd4c2;padding:8px 10px}
.text-link-actions{display:flex;gap:8px;flex-wrap:wrap}.text-link-actions button{padding:9px 14px;border:1px solid #d2d7c8;border-radius:8px;background:#fff;font:inherit;font-size:13px}.text-link-actions button:first-child{background:#282d23;color:white}
.tg-quote{display:block;border-left:3px solid #8a9a68;background:#edf0e4;padding:8px 12px;border-radius:0 9px 9px 0;white-space:pre-wrap;overflow-wrap:anywhere}
.tg-quote-fold{border-left-style:dashed}.post-text .tg-quote-fold>summary{cursor:pointer;font-size:14px;font-weight:600;min-height:32px;line-height:32px}.post-text .tg-quote-fold[open]>summary{margin-bottom:8px}
.tg-pre{display:block;background:#eef0ed;color:#374238;padding:10px 12px;border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere;font-family:Consolas,monospace;font-size:.92em}
.telegram-composer code,.post-text code{background:#eef0ed;border-radius:4px;padding:1px 4px;font-family:Consolas,monospace;font-size:.92em}
.tg-spoiler{background:#9fa697;color:transparent;border-radius:4px;cursor:pointer}.tg-spoiler:focus,.tg-spoiler:active,.telegram-composer .tg-spoiler{color:inherit;background:#e5e8df}.tg-spoiler:focus{outline:1px solid #a5ac96}
@media(max-width:600px){
 #dialog:has(.rich-editor){width:calc(100vw - 16px);max-height:calc(100svh - 16px);padding:18px 14px;border-radius:20px}
 #dialog:has(.rich-editor) h2{font-size:26px;margin:10px 0}
 #dialog:has(.rich-editor) .dialog-top{margin-bottom:8px}
 #dialog:has(.rich-editor) #dialog-body>.hint{font-size:13px;line-height:1.45;margin:0 0 12px}
 .text-toolbar{gap:4px;padding:7px}.text-tool{height:40px;min-width:40px;font-size:18px}.text-tool.tool-word{font-size:12px;padding-inline:9px}
 .telegram-composer{min-height:220px;max-height:39svh;padding:14px;font-size:17px;line-height:1.55}
 #dialog:has(.rich-editor) .dialog-actions{margin-top:14px}
}
