/* The composer and formatted posts share type styles; legacy plain posts retain pre-wrap. */
.community-composer{min-width:0;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--text)}
.community-composer>*{min-width:0}
.community-composer .composer-tools[hidden],.community-composer textarea.composer-input[hidden]{display:none!important}
.composer-topline{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;padding:0 14px;background:var(--surface);border-bottom:1px solid var(--line);border-radius:4px 4px 0 0}
.composer-modes{display:flex;gap:18px;min-width:0}
.composer-modes button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 2px;border:0;border-bottom:2px solid transparent;background:none;color:var(--muted);font:inherit;font-size:14px;font-weight:650;line-height:1.4;white-space:nowrap}
.composer-modes button[aria-pressed=true]{border-bottom-color:var(--accent);color:var(--accent)}
.composer-modes button:hover:not(:disabled){color:var(--ink)}
.composer-counter{margin-left:auto;font-size:12px;line-height:1.5;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.composer-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:8px 10px;border-bottom:1px solid var(--line);background:var(--surface)}
.composer-toolbar button,.composer-codi-button,.composer-link-panel button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:36px;min-height:36px;padding:7px 10px;border:1px solid var(--line);border-radius:3px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px;font-weight:550;line-height:1.5;white-space:nowrap}
.composer-toolbar button{border-color:transparent;background:transparent}
.composer-toolbar button:hover:not(:disabled),.composer-codi-button:hover:not(:disabled),.composer-link-panel button:hover:not(:disabled){background:var(--soft);border-color:var(--line);color:var(--accent)}
.composer-toolbar button[aria-pressed=true],.composer-toolbar button[aria-expanded=true]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.composer-toolbar-group{display:inline-flex;align-items:center;flex-wrap:wrap;gap:3px;min-width:0;padding-right:7px;margin-right:3px;border-right:1px solid var(--line)}
.composer-toolbar-group:last-child{border-right:0;margin-right:0;padding-right:0}
.composer-toolbar [role=separator]{height:22px;width:1px;flex:0 0 1px;margin:0 4px;background:var(--line)}
.composer-toolbar svg,.composer-codi-button svg{width:16px;height:16px;flex-shrink:0}
.composer-insertbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px 12px;padding:10px 14px;border-bottom:1px solid var(--line);background:var(--surface)}
.composer-insertbar>.reference-picker{flex:1 1 280px;margin:0;min-width:0}
.composer-insertbar>.reference-picker:not(.reference-closed){flex-basis:100%}
.composer-insertbar>.reference-closed{padding:0;border:0;border-radius:0;background:transparent;gap:5px 12px}
.composer-insertbar>.reference-closed>span{font-size:12px;line-height:1.6}
.composer-insertbar>.reference-closed>.reference-button{min-height:36px;padding:7px 11px;border-radius:3px}
.composer-codi-button{flex:0 0 auto}
.composer-link-panel{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px;padding:14px;background:var(--soft);border-bottom:1px solid var(--line)}
.composer-link-panel label{display:grid;flex:1 1 190px;gap:6px;min-width:0;color:var(--text);font-size:12px;font-weight:600}
.composer-link-panel input{min-width:0;width:100%;min-height:40px;font-size:16px;padding:8px 10px;background:var(--bg)}
.composer-link-panel button{min-height:40px}
.composer-link-panel>p{flex-basis:100%;margin:0;color:var(--muted);font-size:12px;line-height:1.75;white-space:normal;word-break:keep-all;overflow-wrap:anywhere}
.composer-link-actions,.composer-link-panel>div{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.community-composer textarea.composer-input{display:block;width:100%;min-width:0;min-height:340px;max-height:75vh;margin:0;padding:20px;border:0;border-radius:0;background:var(--bg);color:var(--ink);font:inherit;font-size:16px;font-weight:400;line-height:1.85;letter-spacing:0;white-space:pre-wrap;overflow-wrap:anywhere;resize:vertical;tab-size:4;caret-color:var(--accent)}
.community-composer textarea.composer-input:focus{outline:2px solid var(--blue);outline-offset:-2px}
.community-composer textarea.composer-input::placeholder{color:var(--muted);opacity:1}
.composer-preview{min-height:340px;padding:22px 20px 30px;overflow-wrap:anywhere}
.composer-preview .composer-preview-title{font-size:22px;font-weight:750;line-height:1.5;letter-spacing:-.025em;margin:0 0 22px;padding:0 0 16px;border-bottom:1px solid var(--line);color:var(--ink);word-break:keep-all;overflow-wrap:anywhere;text-wrap:pretty}
.composer-preview .composer-preview-title:empty{display:none}
.composer-plain-preview{min-width:0;font-size:16px;line-height:1.85;color:var(--ink);white-space:pre-wrap;word-break:keep-all;overflow-wrap:anywhere}
.composer-preview .composer-empty{margin:0;color:var(--muted);font-size:14px;line-height:1.8;white-space:normal}
.composer-preview .composer-plain-preview a{color:var(--blue);text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.composer-preview .composer-plain-preview a:hover{color:var(--accent)}
.composer-footer{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:8px 18px;padding:11px 14px;border-top:1px solid var(--line);background:var(--surface);border-radius:0 0 4px 4px}
.composer-status{flex:1 1 190px;margin:0;color:var(--muted);font-size:12px;line-height:1.75;word-break:keep-all;overflow-wrap:anywhere;white-space:pre-line}
.composer-status:empty{display:none}
.composer-help{min-width:0;max-width:100%;color:var(--muted);font-size:12px;line-height:1.75}
.composer-help summary{min-height:28px;cursor:pointer;color:var(--blue);list-style-position:inside;padding:2px 0}
.composer-help[open]{flex-basis:100%}
.composer-help p{margin:7px 0;white-space:normal;word-break:keep-all;overflow-wrap:anywhere}
.composer-help ul,.composer-help ol{margin:8px 0;padding-left:22px}
.composer-help li+li{margin-top:4px}
.composer-help code{padding:1px 4px;background:var(--bg);border:1px solid var(--line);border-radius:3px;color:var(--ink);font-size:12px;overflow-wrap:anywhere}
.community-composer :is(.composer-modes button,.composer-toolbar button,.composer-codi-button,.composer-link-panel button,.composer-link-panel input,.composer-help summary):focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.community-composer :is(.composer-modes button,.composer-toolbar button,.composer-codi-button,.composer-link-panel button):disabled{opacity:.45;cursor:default}

/* Only parsed formatting receives these rules, never the surrounding legacy body. */
.community-richtext{min-width:0;max-width:100%;font-size:16px;line-height:1.85;color:var(--ink);white-space:normal;word-break:keep-all;overflow-wrap:anywhere;text-wrap:pretty}
.community-richtext p{margin:0 0 1em;white-space:normal;line-height:inherit}
.community-richtext h2,.community-richtext h3{color:var(--ink);font-weight:750;line-height:1.5;letter-spacing:-.025em;word-break:keep-all;overflow-wrap:anywhere;text-wrap:pretty}
.community-richtext h2{font-size:24px;margin:1.35em 0 .6em}
.community-richtext h3{font-size:20px;margin:1.2em 0 .6em}
.community-richtext strong{font-weight:750;color:var(--ink)}
.community-richtext em{font-style:italic}
.community-richtext s,.community-richtext del{text-decoration-thickness:1px;color:var(--muted)}
.community-richtext ul,.community-richtext ol{margin:.85em 0 1em;padding-left:1.6em;line-height:inherit}
.community-richtext ul{list-style:disc outside}
.community-richtext ol{list-style:decimal outside}
.community-richtext li{margin:.25em 0;padding-left:.1em;white-space:normal}
.community-richtext li::marker{color:var(--muted)}
.community-richtext li>p{margin:.25em 0}
.community-richtext li>ul,.community-richtext li>ol{margin:.35em 0}
.community-richtext blockquote{margin:1.1em 0;padding:12px 16px;border:0;border-left:3px solid var(--accent);background:var(--surface);color:var(--text)}
.community-richtext blockquote>:last-child{margin-bottom:0}
.community-richtext hr{height:0;margin:1.5em 0;border:0;border-top:1px solid var(--line)}
.community-richtext pre{max-width:100%;margin:1em 0;padding:14px 16px;border:1px solid var(--line);border-radius:4px;background:var(--bg);color:var(--text);font-size:14px;line-height:1.7;white-space:pre;overflow-x:auto;overflow-wrap:normal;word-break:normal;tab-size:4;text-wrap:nowrap}
.community-richtext code{padding:2px 5px;border:1px solid var(--line);border-radius:3px;background:var(--soft);color:var(--ink);font-family:Consolas,'SFMono-Regular',monospace;font-size:.875em;white-space:break-spaces;overflow-wrap:anywhere}
.community-richtext pre code{padding:0;border:0;border-radius:0;background:none;color:inherit;font-size:inherit;white-space:inherit;overflow-wrap:normal}
.community-richtext .community-format-table{max-width:100%;margin:1em 0;overflow-x:auto;overscroll-behavior-x:contain;border:1px solid var(--line);border-radius:4px}
.community-richtext table{width:100%;table-layout:auto;border-collapse:collapse;white-space:normal;line-height:1.7;font-size:14px;text-align:left}
.community-richtext th,.community-richtext td{min-width:160px;padding:9px 12px;border:1px solid var(--line);font-size:inherit;line-height:inherit;vertical-align:top;white-space:normal;overflow-wrap:anywhere}
.community-richtext th{background:var(--soft);color:var(--ink);font-weight:700}
.community-richtext td{background:transparent;color:var(--text)}
.community-richtext .community-format-table>table tr:first-child>*{border-top:0}
.community-richtext .community-format-table>table tr:last-child>*{border-bottom:0}
.community-richtext .community-format-table>table tr>:first-child{border-left:0}
.community-richtext .community-format-table>table tr>:last-child{border-right:0}
.community-richtext a{color:var(--blue);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px;overflow-wrap:anywhere}
.community-richtext a:hover{color:var(--accent)}
.community-richtext a:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:2px}
.community-richtext>:first-child{margin-top:0}
.community-richtext>:last-child{margin-bottom:0}

@media(max-width:650px){
 .composer-topline{padding-inline:11px;gap:6px 10px}.composer-modes{gap:15px}.composer-modes button{min-height:42px;font-size:13px}.composer-counter{font-size:11px}
 .composer-toolbar{gap:3px;padding:7px}.composer-toolbar button{min-width:38px;min-height:40px;padding:7px 8px}.composer-toolbar-group{padding-right:4px;margin-right:0;gap:2px}
 .composer-insertbar{padding:10px;gap:8px}.composer-insertbar>.reference-closed{flex-basis:100%}.composer-codi-button,.composer-insertbar>.reference-closed>.reference-button{min-height:40px}
 .composer-link-panel{padding:11px;gap:10px}.composer-link-panel label{flex-basis:100%}.composer-link-panel button{min-height:42px}
 .community-composer textarea.composer-input{padding:16px 13px;min-height:340px;font-size:16px;line-height:1.85}.composer-preview{padding:18px 13px 24px}.composer-preview .composer-preview-title{font-size:20px;margin-bottom:18px;padding-bottom:14px}
 .composer-footer{padding:10px 11px;gap:5px 10px}.composer-status{flex-basis:100%;font-size:11px}.composer-help{font-size:12px}.composer-help summary{min-height:36px;padding-top:5px}
 .community-richtext h2{font-size:22px}.community-richtext h3{font-size:19px}.community-richtext blockquote{padding:10px 12px}.community-richtext pre{padding:12px;font-size:13px}.community-richtext th,.community-richtext td{padding:8px 10px}
}

/* Direct editing uses the same bounded class vocabulary as stored documents. */
.composer-visual-host[hidden],.composer-table-actions[hidden]{display:none!important}
.composer-visual-host{min-width:0;min-height:340px}
.composer-loading{padding:24px;color:var(--muted)}
.cq-editor{min-height:340px;max-height:70vh;overflow-y:auto;padding:22px 20px;outline:none;caret-color:var(--accent);white-space:pre-wrap}
.cq-editor:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
.cq-editor[contenteditable=false]{opacity:.75}
.cq-editor p:empty::before{content:"\200b"}
.cq-editor .selectedCell{background:var(--accent-soft)}
.cq-editor .ProseMirror-selectednode{outline:2px solid var(--accent)}
.composer-select{display:inline-flex!important;gap:0!important;margin:0!important}
.community-composer .composer-select select{height:36px;min-height:36px;width:auto;max-width:145px;padding:5px 28px 5px 8px;border:1px solid var(--line);background:var(--bg);font-size:13px;font-weight:400;border-radius:3px}
.composer-table-actions{display:flex;flex-wrap:wrap;gap:5px;padding:8px 14px;border-bottom:1px solid var(--line);background:var(--surface)}
.composer-table-actions button{min-height:32px;padding:4px 10px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:3px}
.composer-error{padding:0 14px;margin:10px 0;color:#fca5a5;font-size:13px;line-height:1.6}
.composer-error:empty{display:none}
.community-richtext :is(strong,em,s,u){color:inherit}
.community-richtext .cq-align-left{text-align:left}.community-richtext .cq-align-center{text-align:center}.community-richtext .cq-align-right{text-align:right}.community-richtext .cq-align-justify{text-align:justify}
.community-richtext .cq-line-1{line-height:1}.community-richtext .cq-line-15{line-height:1.5}.community-richtext .cq-line-18{line-height:1.8}.community-richtext .cq-line-2{line-height:2}
.community-richtext .cq-font-sans{font-family:inherit}.community-richtext .cq-font-serif{font-family:Batang,"Noto Serif KR",serif}.community-richtext .cq-font-mono{font-family:Consolas,monospace}
.community-richtext .cq-size-12{font-size:12px}.community-richtext .cq-size-14{font-size:14px}.community-richtext .cq-size-16{font-size:16px}.community-richtext .cq-size-18{font-size:18px}.community-richtext .cq-size-24{font-size:24px}.community-richtext .cq-size-32{font-size:32px}
.community-richtext mark{background:#fef08a;color:#111827}
@media(max-width:650px){.cq-editor{padding:18px 13px;min-height:320px}.composer-toolbar-group{border:0}.community-composer .composer-select select{height:40px;font-size:13px}.composer-toolbar{gap:5px}.composer-table-actions button{min-height:40px}}

.community-richtext .cq-color-f8fafc{color:#f8fafc}.community-richtext .cq-highlight-f8fafc{background-color:#f8fafc;color:#111827}
.community-richtext .cq-color-94a3b8{color:#94a3b8}.community-richtext .cq-highlight-94a3b8{background-color:#94a3b8;color:#111827}
.community-richtext .cq-color-ef4444{color:#ef4444}.community-richtext .cq-highlight-ef4444{background-color:#ef4444;color:#111827}
.community-richtext .cq-color-f97316{color:#f97316}.community-richtext .cq-highlight-f97316{background-color:#f97316;color:#111827}
.community-richtext .cq-color-eab308{color:#eab308}.community-richtext .cq-highlight-eab308{background-color:#eab308;color:#111827}
.community-richtext .cq-color-22c55e{color:#22c55e}.community-richtext .cq-highlight-22c55e{background-color:#22c55e;color:#111827}
.community-richtext .cq-color-3b82f6{color:#3b82f6}.community-richtext .cq-highlight-3b82f6{background-color:#3b82f6;color:#fff}
.community-richtext .cq-color-a855f7{color:#a855f7}.community-richtext .cq-highlight-a855f7{background-color:#a855f7;color:#fff}
.community-richtext .cq-color-000000{color:#000000}.community-richtext .cq-highlight-000000{background-color:#000000;color:#fff}
.community-richtext .cq-color-ffffff{color:#ffffff}.community-richtext .cq-highlight-ffffff{background-color:#ffffff;color:#111827}
.community-richtext .cq-color-fef08a{color:#fef08a}.community-richtext .cq-highlight-fef08a{background-color:#fef08a;color:#111827}

/* Attachments stay inside the post and never add sideways scrolling. */
.composer-upload-status{padding:10px 14px;margin:0;color:var(--blue);font-size:13px}
.composer-upload-status:empty{display:none}
.composer-link-panel>p{flex-basis:100%;margin:0;font-size:12px;color:var(--muted)}
.community-richtext .community-media,.community-richtext .community-post-image{max-width:100%;margin:16px 0;white-space:normal}
.community-richtext .community-editor-image img,.community-richtext .community-post-image img,.community-richtext img.community-post-image{display:block;max-width:100%;height:auto;max-height:720px;object-fit:contain;margin-inline:auto;border-radius:4px}
.community-richtext .community-video,.community-richtext .community-editor-video{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:20px;background:var(--bg);border:1px solid var(--line);border-radius:6px;white-space:normal;overflow-wrap:anywhere}
.community-richtext [data-video-url]{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:180px;padding:24px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:6px;cursor:pointer}
.community-richtext [data-video-url]:hover{border-color:var(--accent);color:var(--accent)}
.community-richtext .community-video-player{display:block;width:100%;height:auto;aspect-ratio:16/9;min-height:200px;border:0;background:#000;border-radius:6px}
.community-richtext .community-video-source{display:block;margin-top:8px;font-size:12px}
@media(max-width:650px){.community-richtext .community-video,.community-richtext .community-editor-video{padding:14px}.community-richtext [data-video-url]{min-height:140px;padding:18px}}

.community-richtext .community-image{max-width:100%;margin:16px 0}
.community-richtext .community-image img{display:block;max-width:100%;height:auto;max-height:720px;object-fit:contain;margin-inline:auto;border-radius:4px}
.community-richtext .community-video-card{max-width:100%;margin:18px 0;white-space:normal}
.community-richtext .community-video-card>a{display:block;margin-top:8px;font-size:13px;overflow-wrap:anywhere}
