/* Naver-inspired controls are limited to the existing white editor. */
.editor-shell{--editor-accent:#03b85a;--editor-border:#e7e7e7;max-width:1200px;margin-inline:auto}
.editor-shell .toolbar{display:block;padding:0;overflow:visible;border-bottom:1px solid #d7d7d7;position:relative;z-index:40;background:#fff;flex-shrink:0}
.editor-shell .insert-toolbar{height:62px;display:flex;gap:2px;align-items:stretch;padding:0 20px;border-bottom:1px solid var(--editor-border)}
.editor-shell .toolbar .insert-tool{position:relative;height:61px;min-width:52px;padding:8px 11px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:transparent;border-radius:0;color:#666;font-size:11px;font-weight:400;line-height:1.1;border:0}
.editor-shell .insert-tool svg{width:22px;height:22px;stroke-width:1.15}.editor-shell .insert-tool .insert-caret{position:absolute;right:1px;top:18px;font-size:10px}.editor-shell .toolbar button:hover:not(:disabled){background:#f4f6f5;color:var(--editor-accent)}
.editor-shell .toolbar button:disabled{opacity:.35}.editor-shell .toolbar .insert-tool[aria-expanded=true]{background:#f2faf5;color:var(--editor-accent)}.editor-shell .insert-toolbar-spacer{flex:1}
.editor-shell .format-toolbar{display:flex;align-items:center;gap:2px;height:37px;padding:2px 20px;background:#fff}
.editor-shell .format-toolbar>button,.editor-shell .format-toolbar>.tool-dropdown>button{height:29px;padding:4px 7px;min-width:27px;font-size:14px;border-radius:2px;color:#626262;line-height:1}
.editor-shell .toolbar select{height:28px;padding:3px 18px 3px 7px;border:0;border-radius:0;background:transparent;font-size:12px;color:#555;max-width:110px}
.editor-shell #format-block{width:72px}.editor-shell #font-name{width:105px}.editor-shell #font-size{width:58px}.editor-shell #line-height{width:100px;min-width:100px;max-width:none;padding-right:24px;flex-shrink:0}
.editor-shell .tool-divider{height:16px;margin:0 6px;border-color:#e4e4e4}.editor-shell .tool-spacer{flex:1}
.editor-shell .color-tool{position:relative;width:26px;height:27px;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:2px;color:#555;font-size:16px}
.editor-shell .color-tool>span{pointer-events:none;text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:4px}
.editor-shell .color-tool.highlight>span{background:#fff0a0;text-decoration:none;padding:0 2px}.editor-shell .color-tool input[type=color]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;padding:0;border:0}
.editor-shell .toolbar button[aria-pressed=true]{color:var(--editor-accent);background:#eff9f3}.editor-shell .format-dropdown{display:flex;align-items:center;gap:6px}.editor-shell .format-dropdown>span:last-child{font-size:10px}
.editor-shell .tool-dropdown{position:relative;flex-shrink:0}.editor-shell .tool-popover{position:absolute;top:100%;left:0;z-index:60;background:#fff;border:1px solid #d7d7d7;box-shadow:0 4px 12px #00000012;min-width:140px;color:#666}
.editor-shell .tool-popover[hidden]{display:none}.editor-shell .tool-popover button{white-space:normal}.editor-shell .alignment-popover{min-width:126px;padding:4px 0}
.editor-shell .toolbar .alignment-popover button{display:flex;align-items:center;gap:16px;width:100%;height:36px;padding:8px 15px;border-radius:0;font-size:12px;text-align:left}
.editor-shell .list-popover{min-width:156px;padding:4px 0}
.editor-shell .toolbar .list-popover button{display:flex;align-items:center;gap:14px;width:100%;height:36px;padding:8px 14px;border-radius:0;font-size:12px;text-align:left;white-space:nowrap}
.editor-shell .list-popover button>span:first-child{min-width:18px;font-size:16px}
.editor-shell .alignment-icon{width:15px;height:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;flex-shrink:0}
.editor-shell .alignment-icon i{display:block;height:1px;width:100%;background:currentColor}.editor-shell .alignment-icon i:nth-child(even){width:66%}
.editor-shell .alignment-icon[data-align=center]{align-items:center}.editor-shell .alignment-icon[data-align=right]{align-items:flex-end}.editor-shell .alignment-icon[data-align=justify] i{width:100%}
.editor-shell .design-popover{width:184px;max-height:min(64vh,530px);overflow:auto;padding:0}
.editor-shell .toolbar .preset-option{height:auto;min-height:58px;width:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;padding:12px 18px;border-bottom:1px solid #eee;border-radius:0;font-size:11px;color:#777;background:#fff}
.editor-shell .preset-option .preset-sample{display:block;width:100%;pointer-events:none}.editor-shell .preset-sample blockquote{font-size:11px;line-height:1.3;width:100%;margin:0!important;padding:10px 12px!important;min-height:28px}
.editor-shell .preset-sample [data-quote=default],.editor-shell .preset-sample [data-quote=underline]{padding-top:24px!important}.editor-shell .preset-sample [data-quote=default]::before,.editor-shell .preset-sample [data-quote=underline]::before{font-size:28px!important}.editor-shell .preset-sample hr{margin:10px auto!important;max-width:100%}.editor-shell .preset-option:has([data-divider=line6]),.editor-shell .preset-option:has([data-divider=line7]){min-height:64px}
.editor-shell .toolbar .preset-edit{width:100%;padding:12px 8px;height:auto;font-size:11px;border-radius:0;color:#666;background:#fafafa}

.editor-shell .toolbar-save{align-self:center;height:31px;margin:0 10px;padding:6px 11px;border:1px solid #dee5ef;border-radius:4px;font-size:12px;background:#fff;color:#203149;white-space:nowrap}
@media(max-width:1000px){.editor-shell .format-toolbar{overflow-x:auto;scrollbar-width:thin}.editor-shell .format-toolbar>.tool-dropdown{position:static}.editor-shell .format-toolbar .tool-popover{top:100%;left:240px}.editor-shell .insert-toolbar{padding:0 12px}}
@media(max-width:620px){.editor-shell .insert-toolbar{padding:0 6px}.editor-shell .toolbar .insert-tool{min-width:39px;padding:8px 6px 6px}.editor-shell .insert-tool svg{width:20px;height:20px}.editor-shell .format-toolbar{padding:2px 8px}.editor-shell .insert-toolbar-spacer{min-width:4px}.editor-shell .toolbar-save{margin:0 4px;font-size:11px;padding:5px 7px}.editor-shell .format-toolbar .tool-popover{left:auto;right:8px}}

/* The image inspector belongs to the viewport, outside the clipped canvas. */
#image-panel{position:fixed;inset:16px 16px auto auto;bottom:auto;width:370px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;z-index:150;border:1px solid var(--line);border-radius:10px;padding:16px;box-shadow:0 8px 32px #142d4e30}
#image-panel .panel-heading{position:sticky;top:-16px;background:#fcfdff;z-index:1;padding:12px 0;margin-top:-4px;align-items:center}
#image-panel #image-close{min-width:40px;min-height:40px;border:1px solid var(--line);border-radius:6px;flex-shrink:0}
#image-panel img{max-height:min(160px,22vh)}
.table-tools{display:flex;align-items:center;gap:14px;padding:8px 20px;border-bottom:1px solid var(--line);background:#f5f8fc;font-size:12px}.table-tools label{display:flex;align-items:center;gap:8px}.table-tools select,.table-tools button{padding:5px 9px;font-size:12px}
@media(max-width:620px){#image-panel{inset:8px 8px auto auto;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.editor-shell #resize-all-images,.editor-shell #font-all{font-size:10px;margin:0 3px;padding:5px}.table-tools{gap:8px;padding:8px}}

/* Compatibility review is a viewport panel, never clipped by the editor. */
#issues-panel{position:fixed;inset:16px 16px auto auto;bottom:auto;width:390px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;z-index:150;border:1px solid var(--line);border-radius:10px;padding:16px;box-shadow:0 8px 32px #142d4e30}
#issues-panel .panel-heading{position:sticky;top:-16px;background:#fcfdff;z-index:1;padding:12px 0;margin-top:-4px;align-items:start}
#issues-panel #issues-close{min-width:40px;min-height:40px;border:1px solid var(--line);border-radius:6px;flex-shrink:0}
@media(max-width:620px){#issues-panel{inset:8px 8px auto auto;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}}

/* Studio colour picker: every swatch applies on click, HEX can be typed directly. */
.editor-shell .format-toolbar>.tool-dropdown>button.color-tool{width:28px;padding:4px 0;font-size:16px}
.editor-shell .color-tool>span{text-decoration-color:#222}
.editor-shell .color-popover:not([hidden]){display:block;width:238px;padding:10px;box-sizing:border-box}
.palette-grid{display:grid;grid-template-columns:repeat(10,1fr);gap:3px}
.editor-shell .palette-swatch{width:19px;height:19px;min-width:0;padding:0;border:1px solid #00000026;border-radius:3px;cursor:pointer}
.editor-shell .palette-swatch:hover,.editor-shell .palette-swatch:focus-visible{outline:2px solid #03b85a;outline-offset:1px}
.palette-label{margin:9px 0 4px;font-size:11px;line-height:1.2;color:#777}
.palette-hex-row{display:flex;gap:6px;margin-top:10px}
.editor-shell .palette-hex-row input{flex:1;min-width:0;width:auto;height:28px;padding:3px 8px;border:1px solid #d7d7d7;border-radius:3px;font:12px/1 ui-monospace,Consolas,monospace;text-transform:lowercase}
.editor-shell .palette-hex-row button,.editor-shell .palette-none{height:28px;padding:3px 10px;border:1px solid #d7d7d7;border-radius:3px;font-size:12px;background:#fff;color:#444;cursor:pointer}
.editor-shell .palette-none{display:block;width:100%;margin-top:8px;background:#fafafa}

/* Table bar: shown while the caret is in a table, with the edits one click away. */
.table-tools{position:relative;z-index:39;flex-wrap:wrap;row-gap:6px;border-left:3px solid #03b85a}
.table-tools>strong{color:#0a7a45;white-space:nowrap}
.table-tool-group{display:inline-flex;gap:4px;align-items:center}
.table-tools button{border:1px solid #d5dde8;border-radius:4px;background:#fff;cursor:pointer;white-space:nowrap}
.table-tools button:hover:not(:disabled){border-color:#03b85a;color:#03874a}
.table-tools button:disabled{opacity:.4;cursor:default}
.table-tools input[type=number]{width:56px;padding:4px 6px;font-size:12px}
.table-tools .tool-dropdown{display:inline-block}

.palette-custom{display:flex;gap:12px;height:130px;margin-bottom:12px}
.palette-spectrum{position:relative;flex:1;touch-action:none;cursor:crosshair;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent);border:1px solid #bbb}
.palette-spectrum i{position:absolute;width:8px;height:8px;border:1px solid white;box-shadow:0 0 0 1px #333;transform:translate(-50%,-50%);pointer-events:none;border-radius:50%}
.editor-shell .palette-hue{writing-mode:vertical-lr;direction:rtl;width:16px;min-width:16px;height:130px;padding:0;appearance:none;background:linear-gradient(to top,red,yellow,lime,cyan,blue,magenta,red);border:1px solid #aaa;border-radius:0;cursor:ns-resize}
.palette-hue::-webkit-slider-thumb{appearance:none;width:22px;height:5px;background:white;border:1px solid #555}
.palette-preview{width:28px;border:1px solid #aaa;flex-shrink:0}

.column-width-control{white-space:nowrap}.table-tools input[type=range]{width:110px;height:18px;padding:0;accent-color:#03a94d;cursor:pointer}.table-tools input[type=range]:disabled{opacity:.4;cursor:default}
/* 저장 전 발행 정보 확인 */
#publication-dialog .notice{margin:0 0 16px}
#publication-dialog .form-grid>label{align-content:start}
.publication-choices{display:flex;gap:6px}
.publication-choices button{font-size:12px;padding:4px 11px;border-radius:999px;color:var(--muted)}
.publication-choices button[aria-pressed="true"]{background:var(--green);border-color:var(--green);color:#fff}
#publication-dialog input[aria-invalid="true"]{border-color:var(--red);outline-color:var(--red)}
.publication-error{margin:2px 0 0;font-size:12px;line-height:1.7;color:var(--red)}
#publication-dialog .dialog-footer button{font-size:13px}

/* 글자를 드래그하면 뜨는 빠른 서식 창 */
.quick-toolbar{position:fixed;z-index:70;background:#fff;border:1px solid #d7d7d7;border-radius:6px;box-shadow:0 4px 14px #0000001f;padding:4px 6px;color:#333;font-size:13px}
.quick-toolbar[hidden]{display:none}
.quick-row{display:flex;align-items:center;gap:2px;white-space:nowrap}
.quick-toolbar select{height:30px;border:0;background:transparent;padding:0 4px;color:#333;cursor:pointer;border-radius:4px}
.quick-toolbar select[data-quick=font]{width:104px}.quick-toolbar select[data-quick=size]{width:52px}
.quick-row>button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:4px;background:transparent;color:#333;font-size:15px}
.quick-row>button:hover,.quick-toolbar select:hover{background:#f1f3f5}
.quick-row>button[aria-pressed=true],.quick-row>button[aria-expanded=true]{color:#03a94d;background:#eefaf2}
.quick-divider{width:1px;height:18px;background:#e2e2e2;margin:0 4px;flex-shrink:0}
.quick-color-mark{display:inline-block;font-weight:700;line-height:15px;padding:0 2px;border-bottom:3px solid #222}
.quick-toolbar .alignment-icon{width:15px;height:14px;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start}
.quick-toolbar .alignment-icon i{display:block;height:1.5px;width:100%;background:currentColor}.quick-toolbar .alignment-icon i:nth-child(even){width:66%}
.quick-toolbar .alignment-icon[data-align=center]{align-items:center}.quick-toolbar .alignment-icon[data-align=right]{align-items:flex-end}.quick-toolbar .alignment-icon[data-align=justify] i{width:100%}
.quick-colors,.quick-link{display:flex;align-items:center;gap:6px;margin-top:4px;padding:6px 2px 2px;border-top:1px solid #eee}
.quick-colors[hidden],.quick-link[hidden]{display:none}
.quick-colors button{width:22px;height:22px;padding:0;border:1px solid #00000022;border-radius:4px}
.quick-colors button:hover{outline:2px solid #03a94d;outline-offset:1px}
.quick-link input{flex:1;min-width:190px;height:30px;font-size:13px;padding:4px 8px}
.quick-link button{height:30px;padding:0 10px;font-size:12px}
.quick-highlight-mark{display:inline-block;font-weight:700;line-height:17px;padding:0 4px;border-radius:2px;background:#fff8b2}
.quick-colors .quick-none{width:auto;padding:0 8px;font-size:12px;background:#fff;color:#555}

/* 글자수 · 찾아 바꾸기 · 원고 정리 · 표 너비 */
.char-count{margin-right:12px;color:var(--muted);font-size:12px;white-space:nowrap}
.editor-shell #find-replace,.editor-shell #tidy-manuscript,.editor-shell #font-all{margin-left:0}
.table-tools #table-width-quick{width:58px}
dialog label.tidy-option{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink)}
dialog label.tidy-option input{width:auto}
.publication-hint{margin:2px 0 0;font-size:12px;line-height:1.7;color:var(--muted)}
/* The table bar floats over the table it edits, like the quote and divider tools, so it never moves the page. */
.table-tools{position:fixed;z-index:60;left:0;top:0;width:max-content;max-width:min(980px,calc(100vw - 32px));gap:10px;padding:7px 10px;border:1px solid #d7d7d7;border-left:3px solid #03b85a;border-radius:6px;background:#fff;box-shadow:0 4px 14px #0000001f}
.table-tools[hidden]{display:none}
.table-align-group{display:inline-flex;align-items:center;gap:4px}.table-align-label{margin-right:4px;white-space:nowrap}
.table-tools [data-table-align]{display:inline-flex;align-items:center;gap:5px}
.table-tools [data-table-align][aria-pressed=true]{border-color:#03b85a;background:#edf9f0;color:#03874a}
.table-tools .alignment-icon{width:15px;height:14px;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;flex-shrink:0}
.table-tools .alignment-icon i{display:block;height:1.5px;width:100%;background:currentColor}.table-tools .alignment-icon i:nth-child(even){width:66%}
.table-tools .alignment-icon[data-align=center]{align-items:center}.table-tools .alignment-icon[data-align=right]{align-items:flex-end}
/* One row of icon buttons; each has its name as a tooltip. */
.table-tools{gap:8px;padding:5px 8px;flex-wrap:nowrap}.table-tools .table-tool-group{display:inline-flex;gap:3px}
.table-tools button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;color:#4a5564}
.table-tools button.danger{color:#c0473f}.table-tools button.danger:hover:not(:disabled){border-color:#c0473f;color:#a2332c}
.table-tools .column-width-control{gap:5px}.table-tools .table-width-icon{display:inline-flex;color:#4a5564}.table-tools input[type=range]{width:96px}
@media(max-width:700px){.table-tools{flex-wrap:wrap}}
