/* Shared rich-text editor (writer portal + admin news form). Extracted from writer.css. */
/* Compose box: sticky grouped toolbar, auto-growing editor, status bar. */
.writer-compose{margin-top:8px;border:1px solid #d6dbe3;border-radius:10px;background:#fff;box-shadow:0 1px 2px #0000000a}
.writer-compose .writer-toolbar{position:sticky;top:0;z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:4px 0;margin:0;padding:6px;background:#f6f7f9;border:0;border-bottom:1px solid #e1e5eb;border-radius:10px 10px 0 0}
.writer-compose .writer-tool-group{display:flex;align-items:center;gap:2px;padding:0 6px;border-right:1px solid #dde1e7}
.writer-compose .writer-tool-group:last-child{border-right:0}
.writer-compose .writer-toolbar button{display:grid;place-items:center;width:36px;height:36px;min-height:0;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:#2f3640;cursor:pointer;transition:background .12s,color .12s,border-color .12s}
.writer-compose .writer-toolbar button svg{width:19px;height:19px}
.writer-compose .writer-toolbar button:hover{background:#fff;border-color:#d6dbe3;color:#111}
.writer-compose .writer-toolbar button[aria-pressed=true]{background:#8f1a00;border-color:#8f1a00;color:#fff}
.writer-compose .writer-toolbar button:focus-visible{outline:2px solid #8f1a00;outline-offset:1px}
.writer-block{height:36px;margin:0;padding:0 28px 0 10px;border:1px solid #d6dbe3;border-radius:8px;background:#fff;color:#2f3640;font:600 15px Shurjo,serif;cursor:pointer}
.writer-compose .writer-editor{height:auto;min-height:360px;max-height:none;resize:none;overflow:visible;margin:0;border:0;border-radius:0;padding:18px 20px;font-size:18px;line-height:1.75;font-weight:400}
.writer-compose .writer-editor:focus{outline:none;box-shadow:inset 0 0 0 2px #8f1a0026}
.writer-compose .writer-editor h2{font-size:24px;line-height:1.4;margin:1.1em 0 .5em}.writer-compose .writer-editor h3{font-size:20px;margin:1em 0 .4em}
.writer-compose .writer-editor blockquote{margin:1em 0;padding:8px 16px;border-left:4px solid #8f1a00;background:#fbf4f2;color:#3b3f45}
.writer-compose .writer-editor ul,.writer-compose .writer-editor ol{margin:0 0 1em;padding-left:1.6em}
.writer-compose .writer-editor a{color:#8f1a00;text-decoration:underline}
.writer-status{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:8px 14px;border-top:1px solid #edf0f3;border-radius:0 0 10px 10px;background:#fafbfc;color:#6b7280;font-size:14px}
.writer-status .warn{color:#b45309;font-weight:600}
.writer-restore{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:8px;padding:10px 14px;border:1px solid #f3d9a8;border-radius:10px;background:#fffaf0;color:#7c4a03;font-size:15px}
.writer-restore span{flex:1 1 220px}.writer-restore button{padding:6px 14px;border:1px solid #d9b56f;border-radius:8px;background:#fff;color:#7c4a03;font:inherit;cursor:pointer}.writer-restore [data-restore]{background:#8f1a00;border-color:#8f1a00;color:#fff}
@media(max-width:600px){.writer-compose .writer-toolbar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}.writer-compose .writer-toolbar::-webkit-scrollbar{display:none}.writer-compose .writer-tool-group{flex-shrink:0;padding:0 4px}.writer-compose .writer-toolbar button{width:40px;height:40px}.writer-compose .writer-editor{min-height:300px;padding:14px;font-size:17px}}
.writer-content-label{margin-bottom:0;cursor:text}
/* Link dialog */
.writer-link-dialog{box-sizing:border-box;width:min(460px,calc(100vw - 24px));padding:0;border:0;border-radius:16px;background:#fff;color:#252b33;font-family:Shurjo,serif;box-shadow:0 24px 70px #0005;overflow:hidden}
.writer-link-dialog[open]{animation:wl-pop .22s cubic-bezier(.2,.9,.3,1.15)}
.writer-link-dialog::backdrop{background:#10131a99;backdrop-filter:blur(3px)}
.writer-link-dialog::before{content:'';display:block;height:3px;background:linear-gradient(90deg,#8f1a00,#d2452a 50%,#8f1a00)}
.writer-link-dialog form{margin:0;padding:18px 20px 18px}
.writer-link-dialog header{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px}
.wl-icon{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;border-radius:12px;background:#fbefeb;color:#8f1a00}.wl-icon svg{width:21px;height:21px}
.writer-link-dialog header div{flex:1;min-width:0}.writer-link-dialog h2{margin:0;font-size:19px;color:#2f3640}
.writer-link-dialog [data-quote]{margin:3px 0 0;font-size:14px;color:#6b7280;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wl-close{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:none;color:#9aa1ac;cursor:pointer}.wl-close svg{width:20px;height:20px}.wl-close:hover{background:#f3f4f7;color:#3b424d}
.writer-link-dialog label{display:block;margin:0;font-size:15px;color:#4b5563}
.writer-link-dialog [data-url]{display:block;box-sizing:border-box;width:100%;margin-top:6px;padding:12px 14px;border:1.5px solid #d6dbe3;border-radius:10px;background:#fafbfc;color:#111;font:16px/1.4 system-ui,sans-serif;direction:ltr}
.writer-link-dialog [data-url]:focus{outline:none;border-color:#8f1a00;background:#fff;box-shadow:0 0 0 4px #8f1a001a}
.writer-link-dialog [data-error]{display:block;min-height:20px;margin-top:6px;font-size:14px;color:#b91c1c}
.writer-link-dialog footer{display:flex;align-items:center;gap:8px;margin-top:6px}.writer-link-dialog footer span{flex:1}
.writer-link-dialog footer button{min-height:42px;padding:8px 18px;border-radius:10px;font:600 15px Shurjo,serif;cursor:pointer}
.wl-cancel{border:1px solid #d6dbe3;background:#fff;color:#374151}.wl-cancel:hover{background:#f6f7f9}
.wl-ok{border:0;background:#8f1a00;color:#fff;box-shadow:0 6px 14px #8f1a0033}.wl-ok:hover{background:#7a1600}
.wl-remove{border:0;background:none;color:#b91c1c;padding-left:4px!important}.wl-remove:hover{text-decoration:underline}
@keyframes wl-pop{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:none}}
@media(max-width:600px){.writer-link-dialog footer{flex-wrap:wrap}.writer-link-dialog footer span{display:none}.wl-cancel,.wl-ok{flex:1}.wl-remove{order:3;width:100%}}
@media(prefers-reduced-motion:reduce){.writer-link-dialog[open]{animation:none}}
/* Toolbar v3: one row, end group pinned right */
.writer-compose .writer-toolbar{flex-wrap:nowrap;gap:0}
.writer-tool-main{display:flex;flex-wrap:wrap;align-items:center;row-gap:4px;flex:1 1 auto;min-width:0}
.writer-tool-end{display:flex;align-items:center;flex:0 0 auto;margin-left:auto;padding-left:4px;border-left:1px solid #dde1e7}
.writer-tool-end .writer-tool-group:last-child{border-right:0}
.writer-compose .writer-toolbar button.has-chev{width:auto;padding:0 4px 0 8px;gap:0;grid-auto-flow:column}
.writer-compose .writer-toolbar button .chev{width:14px;height:14px;opacity:.6}
.writer-compose .writer-toolbar button:has(.tb-text){width:auto;padding:0 10px;grid-auto-flow:column;gap:6px}
.tb-text{font:600 14px Shurjo,serif}
.writer-block{width:auto;max-width:150px}
/* Menus */
.writer-menu{position:fixed;z-index:1000;min-width:230px;max-width:calc(100vw - 16px);padding:6px;border:1px solid #e1e5eb;border-radius:12px;background:#fff;box-shadow:0 14px 40px #0000002b;animation:wl-pop .14s ease-out}
.writer-menu>button{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border:0;border-radius:8px;background:none;color:#2f3640;font:15px Shurjo,serif;text-align:left;cursor:pointer}
.writer-menu>button svg{width:18px;height:18px;flex-shrink:0;color:#6b7280}.writer-menu>button span{flex:1}
.writer-menu>button:hover,.writer-menu>button:focus-visible{background:#f4f5f7;outline:none}.writer-menu>button.on{color:#8f1a00;font-weight:700}.writer-menu>button.on svg{color:#8f1a00}
.writer-menu kbd,.wd-keys kbd{padding:1px 6px;border:1px solid #d6dbe3;border-bottom-width:2px;border-radius:5px;background:#fafbfc;font:12px system-ui,sans-serif;color:#4b5563}
.writer-chars{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;margin:4px 0;padding:8px 6px;border-top:1px solid #eef0f3;border-bottom:1px solid #eef0f3}
.writer-chars>span{grid-column:1/-1;display:flex;align-items:center;gap:8px;margin:0 4px 4px;font-size:13px;color:#6b7280}.writer-chars>span svg{width:16px;height:16px}
.writer-chars button{height:34px;border:1px solid #e5e7eb;border-radius:7px;background:#fff;font:18px system-ui,sans-serif;color:#1f2937;cursor:pointer}.writer-chars button:hover{border-color:#8f1a00;color:#8f1a00}
/* Dialog extras */
.writer-link-dialog.wide{width:min(980px,calc(100vw - 24px))}
.wd-body label{margin-bottom:10px}.wd-body input[type=text],.wd-body input[type=search]{display:block;box-sizing:border-box;width:100%;margin-top:6px;padding:11px 14px;border:1.5px solid #d6dbe3;border-radius:10px;background:#fafbfc;font:16px Shurjo,serif}
.wd-body input[type=text]:focus,.wd-body input[type=search]:focus{outline:none;border-color:#8f1a00;background:#fff;box-shadow:0 0 0 4px #8f1a001a}
.wd-note{margin:6px 0 0;font-size:14px;color:#6b7280}
.wd-preview{display:block;width:100%;max-height:260px;object-fit:contain;margin-bottom:12px;border-radius:10px;background:#f3f4f6}
.wd-body progress{width:100%;height:6px;accent-color:#8f1a00}
.wd-results{display:flex;flex-direction:column;gap:6px;max-height:min(52vh,420px);overflow:auto;margin-top:4px}
.wd-result{display:flex;align-items:center;gap:12px;width:100%;padding:8px;border:1px solid #eceef2;border-radius:10px;background:#fff;text-align:left;cursor:pointer}.wd-result:hover{border-color:#8f1a00;background:#fffaf8}
.wd-result img,.wd-noimg{flex:0 0 72px;width:72px;height:48px;object-fit:cover;border-radius:6px;background:#eef0f3}.wd-result strong{display:block;font:600 15px/1.45 Shurjo,serif;color:#1f2329}.wd-result small{font-size:12px;color:#8a909b}
.wd-keys{width:100%;border-collapse:collapse;font-size:15px}.wd-keys td{padding:8px 4px;border-bottom:1px solid #f0f1f4}.wd-keys td:last-child{text-align:right;white-space:nowrap}
.wd-devices{display:inline-flex;margin-bottom:10px;padding:3px;border-radius:10px;background:#f1f3f6}.wd-devices button{padding:6px 16px;border:0;border-radius:8px;background:none;font:600 14px Shurjo,serif;color:#4b5563;cursor:pointer}.wd-devices button[aria-pressed=true]{background:#fff;color:#8f1a00;box-shadow:0 1px 3px #0000001f}
.wd-frame-wrap{margin:0 auto;height:min(68vh,760px);border:1px solid #e1e5eb;border-radius:14px;overflow:hidden;background:#fff;transition:width .25s}.wd-frame-wrap.mobile{width:390px;max-width:100%}.wd-frame-wrap.desktop{width:100%}
.wd-frame{display:block;width:100%;height:100%;border:0}
/* Fullscreen writing */
.writer-compose.is-full{position:fixed;inset:0;z-index:900;display:flex;flex-direction:column;margin:0;border:0;border-radius:0}
.writer-compose.is-full .writer-toolbar{border-radius:0}.writer-compose.is-full .writer-editor{flex:1;overflow:auto;padding:28px max(20px,calc(50vw - 380px));font-size:19px}
.writer-compose.is-full .writer-status{border-radius:0}
html.writer-full-open,html.writer-full-open body{overflow:hidden}
/* Body content inside the editor */
.writer-compose .writer-editor figure{margin:1.2em 0}.writer-compose .writer-editor figure img{display:block;max-width:100%;height:auto;border-radius:8px}
.writer-compose .writer-editor figcaption{margin-top:6px;font-size:14px;color:#6b7280;text-align:center}
.writer-compose .writer-editor hr{margin:1.6em auto;width:40%;border:0;border-top:1px solid #d6dbe3}
.writer-compose .writer-editor p>a[href*="youtube.com"]:only-child,.writer-compose .writer-editor p>a[href*="youtu.be"]:only-child,.writer-compose .writer-editor p>a[href*="facebook.com"]:only-child,.writer-compose .writer-editor p>a[href*="fb.watch"]:only-child{display:block;padding:14px 16px;border:1px dashed #c9cfd8;border-radius:10px;background:#f7f8fa;color:#1f2937;text-decoration:none;font-weight:600}
.writer-length{display:block;margin:-8px 2px 10px;font-size:13px;color:#8a909b}.writer-length.warn{color:#b45309}
@media(max-width:600px){.writer-tool-main{flex-wrap:nowrap}.writer-compose .writer-toolbar{overflow-x:auto}.writer-tool-end{position:sticky;right:0;background:#f6f7f9;box-shadow:-8px 0 10px -6px #0000001f}.tb-text{display:none}.writer-compose .writer-toolbar button:has(.tb-text){width:40px;padding:0}.writer-compose.is-full .writer-editor{padding:18px 16px}.wd-frame-wrap{height:62vh}}
/* Compact single row */
.writer-compose .writer-toolbar{padding:5px 6px}
.writer-compose .writer-tool-group{padding:0 4px;gap:1px}
.writer-compose .writer-toolbar button{width:34px;height:34px}
.writer-compose .writer-toolbar button svg{width:18px;height:18px}
.writer-block{height:34px;max-width:118px;padding:0 22px 0 8px;font-size:14px}
.writer-compose .writer-toolbar button.tb-insert{background:#fff;border-color:#d6dbe3;color:#8f1a00}
.writer-compose .writer-toolbar button.tb-insert:hover{border-color:#8f1a00}
@media(max-width:600px){.writer-tool-main{flex:0 0 auto}.writer-compose .writer-toolbar button{width:40px;height:40px}.writer-block{height:40px}}
/* Text colour */
.writer-compose .writer-toolbar button.tb-color{position:relative}
.tb-color-bar{position:absolute;left:9px;right:9px;bottom:5px;height:3px;border-radius:2px}
.writer-color-menu{min-width:224px}
.writer-swatches{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;padding:6px 6px 10px;border-bottom:1px solid #eef0f3;margin-bottom:4px}
.writer-swatches button{width:26px;height:26px;padding:0;border:2px solid #fff;border-radius:50%;background:var(--sw);box-shadow:0 0 0 1px #d6dbe3;cursor:pointer;transition:transform .1s}
.writer-swatches button:hover,.writer-swatches button:focus-visible{transform:scale(1.15);box-shadow:0 0 0 2px var(--sw);outline:none}
.writer-custom-color{display:flex;align-items:center;gap:10px;margin:0;padding:9px 10px;border-radius:8px;font:15px Shurjo,serif;color:#2f3640;cursor:pointer}
.writer-custom-color:hover{background:#f4f5f7}.writer-custom-color svg{width:18px;height:18px;color:#6b7280}.writer-custom-color span{flex:1}
.writer-custom-color input{width:28px;height:24px;padding:0;border:1px solid #d6dbe3;border-radius:6px;background:none;cursor:pointer}
@media(min-width:601px){.writer-compose .writer-tool-group{padding:0 3px}.writer-compose .writer-toolbar button{width:32px;height:34px}.writer-block{max-width:104px}.writer-compose .writer-toolbar button.has-chev{padding:0 2px 0 6px}}
.wd-two{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
/* Admin form: the shared editor replaces the old toolbar; keep the admin card look */
.np-admin-editor.writer-compose{margin-top:6px}.np-admin-editor .writer-editor{font-family:Shurjo,serif;text-align:justify}
.writer-compose #article-source{display:block;width:100%;min-height:420px;box-sizing:border-box;border:0;border-top:1px solid #e1e5eb;padding:16px;font:14px/1.6 ui-monospace,monospace}
.writer-compose #article-source[hidden]{display:none}
/* Narrow editors (e.g. the admin form column): undo/redo move into the ⋯ menu so the toolbar stays one row. */
.writer-compose{container-type:inline-size}
@container (max-width:760px){.writer-compose .tb-history{display:none}}
/* Phones: the whole toolbar scrolls; nothing is pinned so every tool is reachable. */
@media(max-width:600px){.writer-tool-end{position:static;box-shadow:none;background:none}}
