/* UDKiNG กรอบแก้ไขข้อความ V12 */
.rte{--primary:#1264e7;--dark:#0d2347;--surface:#f2f8ff;position:relative;border:1px solid #c9d8ea;border-radius:10px;background:#fff;display:flex;flex-direction:column;font-family:Prompt,"Noto Sans Thai",system-ui,sans-serif;color:#14243b}
.rte:focus-within{border-color:#4d94f0;box-shadow:0 0 0 3px #4d94f022}
.rte-bar{display:flex;flex-wrap:wrap;align-items:center;gap:2px 0;padding:5px 6px;background:#f8fafc;border-bottom:1px solid #e3e9f1;border-radius:10px 10px 0 0;position:sticky;top:0;z-index:3}
.rte-g{display:flex;align-items:center;gap:1px;padding:0 5px;border-right:1px solid #e3e9f1}
.rte-g:last-child{border-right:0}
.rte-br{flex-basis:100%;height:0}
.rte-bar button{display:inline-flex;align-items:center;gap:1px;border:0;background:transparent;border-radius:6px;height:30px;min-width:30px;padding:0 5px;cursor:pointer;color:#33465f}
.rte-bar button:hover{background:#e8eef6}
.rte-bar button.on{background:#dceafe;color:#1157c8}
.rte-bar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rte-bar button[data-cmd="bold"] svg{stroke-width:2.6}
.rte-dd button{position:relative;padding-bottom:4px}
.rte-sw{position:absolute;left:7px;bottom:3px;width:16px;height:3px;border-radius:2px}
.rte-dd .car{width:0;height:0;border:4px solid transparent;border-top-color:#64748b;margin:4px 0 0 2px}
.rte-bar select{height:30px;border:0;background:transparent;border-radius:6px;padding:0 4px;font:inherit;font-size:13px;color:#33465f;cursor:pointer;max-width:118px}
.rte-bar select:hover{background:#e8eef6}
.rte-body{position:relative;flex:1;display:flex}
.rte-area{flex:1;min-height:260px;padding:14px 18px;outline:none;overflow:auto;resize:vertical;font-size:15px;line-height:1.85;color:#28405e}
.rte.is-empty .rte-area:before{content:attr(data-ph);color:#9aabbf;position:absolute;pointer-events:none}
.rte-area img{cursor:pointer}
.rte-area img.rte-on{outline:3px solid #1466e8;outline-offset:2px}
.rte-area table{border-collapse:collapse;width:100%}
.rte-area td,.rte-area th{border:1px dashed #b9cbe0;padding:8px;min-width:40px}
.rte-src{flex:1;min-height:260px;border:0;padding:14px;font:13px/1.6 ui-monospace,Consolas,monospace;resize:vertical;outline:none;background:#0f172a;color:#e2e8f0}
.rte.src-mode .rte-bar button:not([data-cmd="source"]):not([data-cmd="full"]),.rte.src-mode .rte-bar select{opacity:.35;pointer-events:none}
.rte-foot{display:flex;justify-content:space-between;gap:10px;padding:5px 10px;border-top:1px solid #edf1f6;font-size:11.5px;color:#7b8fa4;background:#fbfcfe;border-radius:0 0 10px 10px}
.rte-pop{position:absolute;z-index:20;background:#fff;border:1px solid #d9e3ef;border-radius:12px;box-shadow:0 14px 34px #0b1d3a2e;padding:8px;min-width:180px}
.rte-pop.wide{width:min(460px,calc(100% - 8px))}
.rte-sws{display:grid;grid-template-columns:repeat(6,24px);gap:6px}
.rte-sws button{width:24px;height:24px;border-radius:6px;border:1px solid #0002;cursor:pointer;padding:0}
.rte-more{display:flex;align-items:center;justify-content:space-between;margin-top:8px;font-size:12px;color:#4d6584}
.rte-more input{width:34px;height:26px;border:0;padding:0;background:none}
.rte-menu{display:grid}
.rte-menu button{border:0;background:none;text-align:left;padding:9px 10px;border-radius:8px;font:inherit;font-size:13px;cursor:pointer;white-space:nowrap}
.rte-menu button:hover{background:#eef3fa}
.rte-grid{display:grid;grid-template-columns:repeat(8,18px);gap:3px}
.rte-grid i{width:18px;height:18px;border:1px solid #cbd7e6;border-radius:3px;cursor:pointer}
.rte-grid i.on{background:#cfe2ff;border-color:#4d94f0}
.rte-gl{display:block;text-align:center;font-size:12px;color:#4d6584;margin-top:6px}
.rte-form{display:grid;gap:8px;min-width:260px;font-size:12.5px;color:#4d6584}
.rte-form label{display:grid;gap:4px}
.rte-form input:not([type=checkbox]),.rte-form textarea{width:100%;box-sizing:border-box;border:1px solid #d5e0ec;border-radius:8px;padding:8px 10px;font:inherit;font-size:13px;color:#14243b}
.rte-form .rte-ck{display:flex;align-items:center;gap:6px}
.rte-form small{color:#8396ad}
.rte-fa{display:flex;justify-content:flex-end;gap:6px}
.rte-fa button{border:0;border-radius:8px;padding:7px 14px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.rte-cancel{background:#eef3fa;color:#1d3b63}.rte-ok{background:#1466e8;color:#fff}
.rte-imgbar{position:absolute;z-index:15;display:flex;gap:2px;background:#0f172a;border-radius:9px;padding:3px;box-shadow:0 8px 20px #0005}
.rte-imgbar button{border:0;background:none;color:#fff;font:inherit;font-size:12px;padding:5px 8px;border-radius:6px;cursor:pointer;white-space:nowrap}
.rte-imgbar button:hover{background:#ffffff22}.rte-imgbar .dg:hover{background:#e5484d}
.rte.busy:after{content:"กำลังย่อรูป…";position:absolute;inset:auto 10px 34px auto;background:#0f172a;color:#fff;font-size:12px;padding:5px 10px;border-radius:8px}
.rte.full{position:fixed;inset:16px;z-index:1000;box-shadow:0 30px 80px #0b1d3a66}
.rte.full .rte-area{max-width:860px;width:100%;margin:0 auto;resize:none;font-size:16.5px}
.rte.full .rte-body{overflow:auto;background:#fff}
body.rte-lock{overflow:hidden}
body.rte-lock:after{content:"";position:fixed;inset:0;background:#0b1d3a80;z-index:999}

.rte-path.warn{color:#c2410c;font-weight:700}
