/* ASCIISOFT WebEditor */

/* ===== 테마 변수 (classic = 기본, 각진 디자인) ===== */
.asw-editor {
  --asw-border: #d3d8e0;
  --asw-radius: 0px;
  --asw-tb-bg: #f7f9fc;
  --asw-tb-line: #e3e6ec;
  --asw-icon: #50586a;
  --asw-hover-bg: rgba(46, 83, 146, .09);
  --asw-on-bg: rgba(46, 83, 146, .15);
  --asw-on-fg: #2e5392;
  --asw-sep: #d9dde5;
  --asw-btn-radius: 2px;
  --asw-pop-radius: 2px;
  --asw-sel-border: transparent;
  --asw-body-bg: #ffffff;
  --asw-text: #1f2733;
  --asw-accent: #2e5392;
  --asw-check-radius: 1px;
  --asw-lh: 1.15;
  --asw-btn: 30px;
}
/* 둥근 디자인 (0.1 버전 디자인) */
.asw-theme-round {
  --asw-border: #d2d7e0; --asw-radius: 8px; --asw-tb-bg: #ffffff; --asw-tb-line: #e3e7ee;
  --asw-icon: #45506a; --asw-btn-radius: 6px; --asw-pop-radius: 8px; --asw-sel-border: #dfe4ec;
  --asw-check-radius: 4px;
}
/* 아래 5개는 위가 밝고 아래가 살짝 어두운 그라데이션 툴바 */
.asw-theme-black {
  --asw-border: #2b2e33; --asw-tb-bg: linear-gradient(#41454c, #2f3237); --asw-tb-line: #1f2125;
  --asw-icon: #eceef2; --asw-hover-bg: rgba(255, 255, 255, .13); --asw-on-bg: rgba(255, 255, 255, .22); --asw-on-fg: #ffffff;
  --asw-sep: rgba(255, 255, 255, .2);
}
.asw-theme-light-gray {
  --asw-border: #c8c8c8; --asw-tb-bg: linear-gradient(#f7f7f7, #e6e6e6); --asw-tb-line: #cfcfcf;
  --asw-icon: #3c4048; --asw-hover-bg: rgba(0, 0, 0, .07); --asw-on-bg: rgba(0, 0, 0, .12); --asw-on-fg: #1f2329;
  --asw-sep: #c6c6c6;
}
.asw-theme-dark-gray {
  --asw-border: #54575c; --asw-tb-bg: linear-gradient(#777b82, #63676d); --asw-tb-line: #4e5156;
  --asw-icon: #ffffff; --asw-hover-bg: rgba(255, 255, 255, .15); --asw-on-bg: rgba(255, 255, 255, .26); --asw-on-fg: #ffffff;
  --asw-sep: rgba(255, 255, 255, .28);
}
.asw-theme-white {
  --asw-border: #d8dbe1; --asw-tb-bg: linear-gradient(#ffffff, #f3f4f6); --asw-tb-line: #e1e3e8;
  --asw-icon: #3d4451; --asw-hover-bg: rgba(0, 0, 0, .055); --asw-on-bg: rgba(46, 83, 146, .13);
  --asw-sep: #dcdfe4;
}
.asw-theme-blue {
  --asw-border: #a9c2e6; --asw-tb-bg: linear-gradient(#eef5fe, #d9e7f9); --asw-tb-line: #bcd1ef;
  --asw-icon: #2c4f88; --asw-hover-bg: rgba(44, 79, 136, .10); --asw-on-bg: rgba(44, 79, 136, .18); --asw-on-fg: #1d4384;
  --asw-sep: #b8cdec; --asw-accent: #2c5aa8;
}

/* ===== 틀 ===== */
.asw-editor { position: relative; border: 1px solid var(--asw-border); border-radius: var(--asw-radius); font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Noto Sans KR", sans-serif; color: var(--asw-text); background: var(--asw-body-bg); box-sizing: border-box; text-align: left; }
.asw-editor *, .asw-layer, .asw-layer * { box-sizing: border-box; }
.asw-editor.asw-fill { display: flex; flex-direction: column; }
.asw-editor.asw-fill > .asw-body, .asw-editor.asw-fill > .asw-html { flex: 1 1 auto; min-height: 0; height: auto; }
.asw-flex { flex: 1 1 auto; }

/* ===== 툴바 (버튼 크기 --asw-btn 에 맞춰 높이 자동) ===== */
.asw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; padding: 3px 6px; background: var(--asw-tb-bg); border-bottom: 1px solid var(--asw-tb-line); border-radius: calc(var(--asw-radius) - 1px) calc(var(--asw-radius) - 1px) 0 0; }
.asw-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--asw-btn); height: var(--asw-btn); padding: 0; margin: 0; border: 0; background: transparent; color: var(--asw-icon); border-radius: var(--asw-btn-radius); cursor: pointer; font-size: calc(var(--asw-btn) * .5); line-height: 1; }
.asw-btn:hover { background: var(--asw-hover-bg); }
.asw-btn.on, .asw-btn.open { background: var(--asw-on-bg); color: var(--asw-on-fg); }
.asw-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.asw-btn svg { width: 60%; height: 60%; }
.asw-btn:focus { outline: none; }
.asw-btn:focus-visible { outline: 2px solid var(--asw-accent); outline-offset: -2px; }
.asw-sep { width: 1px; align-self: center; height: calc(var(--asw-btn) * .56); background: var(--asw-sep); margin: 0 5px; }
.asw-dd-trigger { width: auto; min-width: var(--asw-btn); padding: 0 1px 0 0; }
.asw-dd-trigger > svg:first-child { width: calc(var(--asw-btn) * .6); height: calc(var(--asw-btn) * .6); }
.asw-dd-trigger > svg:last-child { width: calc(var(--asw-btn) * .34); height: calc(var(--asw-btn) * .34); margin-left: -2px; opacity: .75; }

/* 글꼴/크기 선택: 선 없이 상하 화살표 */
.asw-selwrap { position: relative; display: inline-flex; align-items: center; height: var(--asw-btn); }
.asw-select { -webkit-appearance: none; -moz-appearance: none; appearance: none; height: calc(var(--asw-btn) - 4px); width: 9.7em; padding: 0 calc(var(--asw-sel-fs, 12px) + 9px) 0 .65em; margin: 0; border: 1px solid var(--asw-sel-border); border-radius: var(--asw-btn-radius); background: transparent; color: var(--asw-icon); font: inherit; font-size: var(--asw-sel-fs, 12px); line-height: 1; cursor: pointer; text-overflow: ellipsis; }
.asw-selwrap[data-id="fontSize"] .asw-select { width: 6em; }
.asw-select:hover { background: var(--asw-hover-bg); }
.asw-select:focus { outline: none; }
.asw-select:focus-visible { outline: 2px solid var(--asw-accent); outline-offset: -2px; }
.asw-select option { color: #1f2733; background: #fff; }
.asw-selico { position: absolute; right: 4px; top: 50%; width: calc(var(--asw-sel-fs, 12px) + 2px); height: calc(var(--asw-sel-fs, 12px) + 2px); margin-top: calc(var(--asw-sel-fs, 12px) / -2 - 1px); color: var(--asw-icon); opacity: .7; pointer-events: none; }
.asw-selico svg { width: 100%; height: 100%; display: block; }
.asw-theme-round .asw-select { background: #fff; }

/* ===== 본문 ===== */
.asw-body { position: relative; display: flex; flex-direction: column; background: var(--asw-body-bg); }
.asw-body.asw-fixed, .asw-fill > .asw-body { overflow: auto; }
.asw-editor:not(:has(.asw-modebar)) > .asw-body, .asw-editor:not(:has(.asw-modebar)) > .asw-html { border-radius: 0 0 calc(var(--asw-radius) - 1px) calc(var(--asw-radius) - 1px); }
.asw-placeholder { position: absolute; left: 14px; right: 14px; top: 12px; color: #9aa3b2; pointer-events: none; line-height: var(--asw-lh); white-space: pre-wrap; z-index: 1; }

.asw-content, .asw-view { line-height: var(--asw-lh, 1.15); color: inherit; word-wrap: break-word; overflow-wrap: break-word; }
.asw-content { flex: 1 1 auto; outline: none; padding: 12px 14px; min-height: inherit; white-space: pre-wrap; }
.asw-content:focus { outline: none; }
.asw-content p, .asw-view p { margin: 0 0 4px; }
.asw-content h1, .asw-view h1 { font-size: 1.7em; margin: .4em 0; }
.asw-content h2, .asw-view h2 { font-size: 1.4em; margin: .4em 0; }
.asw-content h3, .asw-view h3 { font-size: 1.2em; margin: .4em 0; }
.asw-content blockquote, .asw-view blockquote { border-left: 3px solid #c7d3ea; margin: 6px 0; padding: 2px 12px; color: #52607a; }
.asw-content pre, .asw-view pre { background: #f5f7fa; border: 1px solid #e6e9ef; border-radius: var(--asw-pop-radius, 2px); padding: 8px 10px; overflow: auto; line-height: 1.45; margin: 6px 0; white-space: pre; }
.asw-content code, .asw-view code { background: #f0f2f6; padding: 1px 4px; border-radius: 3px; font-family: Consolas, "Courier New", monospace; font-size: .92em; }
.asw-content pre code, .asw-view pre code { background: none; padding: 0; border-radius: 0; }
.asw-content hr, .asw-view hr { border: 0; border-top: 1px solid #d3d8e1; margin: 12px 0; }
.asw-content ul, .asw-content ol, .asw-view ul, .asw-view ol { padding-left: 24px; margin: 4px 0; }
.asw-content li > p, .asw-view li > p { margin: 0 0 2px; }
.asw-content a, .asw-view a { color: #2e5392; text-decoration: underline; }
.asw-content img, .asw-view img { max-width: 100%; height: auto; }

/* 체크박스 목록 */
.asw-content li[data-checked] { list-style: none; display: flex; align-items: flex-start; gap: 7px; margin-left: -18px; }
.asw-check { flex: none; width: 14px; height: 14px; margin-top: calc((1em * var(--asw-lh) - 14px) / 2 + 1px); border: 1.5px solid #8b94a6; border-radius: var(--asw-check-radius); background: #fff; cursor: pointer; }
.asw-content li[data-checked="true"] > .asw-check { background: var(--asw-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.2'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--asw-accent); }
.asw-check-body { flex: 1 1 auto; min-width: 0; }
.asw-view li[data-checked] { list-style: none; position: relative; }
.asw-view li[data-checked]::before { content: ""; position: absolute; left: -20px; top: .1em; width: 13px; height: 13px; border: 1.5px solid #8b94a6; border-radius: 1px; background: #fff; }
.asw-view li[data-checked="true"]::before { background: #2e5392; border-color: #2e5392; }

/* 표 */
.asw-content .tableWrapper { overflow-x: auto; overflow-y: hidden; margin: 6px 0; }
.asw-content table, .asw-view table { border-collapse: collapse; margin: 6px 0; }
.asw-content .tableWrapper > table { margin: 0; }
.asw-content td, .asw-content th, .asw-view td, .asw-view th { border: 1px solid #c4cad4; padding: 5px 8px; min-width: 36px; vertical-align: top; position: relative; }
.asw-content th, .asw-view th { background: #eef1f6; font-weight: 600; color: inherit; }
.asw-content td > p:last-child, .asw-content th > p:last-child, .asw-view td > p:last-child, .asw-view th > p:last-child { margin-bottom: 0; }
/* 세로선에 커서를 올리면 셀 끝에 열 폭 조절 손잡이(div)가 붙어 p 가 마지막 자식이 아니게 되므로, 그때도 여백이 생기지 않게 (행 높이 변동 방지) */
.asw-content td > p:has(+ .column-resize-handle:last-child), .asw-content th > p:has(+ .column-resize-handle:last-child) { margin-bottom: 0; }
.asw-content .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 4px; z-index: 20; background: #4a7bd0; pointer-events: none; }
.asw-content td:last-child > .column-resize-handle, .asw-content th:last-child > .column-resize-handle { right: 0; }   /* 맨 오른쪽 열은 표 밖으로 나가 가로 스크롤이 생기지 않게 */
.asw-content.resize-cursor { cursor: col-resize; }
.asw-content.asw-row-resize, .asw-content.asw-row-resize td, .asw-content.asw-row-resize th, .asw-content.asw-row-dragging { cursor: row-resize; }
.asw-content .selectedCell::after { content: ""; position: absolute; inset: 0; background: rgba(46, 83, 146, .16); pointer-events: none; z-index: 2; }
.asw-content .ProseMirror-selectednode { outline: 2px solid #4a7bd0; }
.asw-content.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid #000; animation: asw-blink 1.1s steps(2, start) infinite; }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
@keyframes asw-blink { to { visibility: hidden; } }

/* 이미지: 선택 시 모서리 핸들로 크기 조절 */
.asw-img { position: relative; display: inline-block; max-width: 100%; line-height: 0; vertical-align: bottom; }
.asw-img img { max-width: 100%; height: auto; display: block; }
.asw-img.sel img, .asw-img.resizing img { outline: 2px solid #4a7bd0; outline-offset: 0; }
.asw-img-h { position: absolute; width: 9px; height: 9px; background: #4a7bd0; border: 1.5px solid #fff; display: none; z-index: 3; }
.asw-img.sel .asw-img-h, .asw-img.resizing .asw-img-h { display: block; }
.asw-img-h.nw { left: -4px; top: -4px; cursor: nwse-resize; } .asw-img-h.se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.asw-img-h.ne { right: -4px; top: -4px; cursor: nesw-resize; } .asw-img-h.sw { left: -4px; bottom: -4px; cursor: nesw-resize; }
.asw-img-size { position: absolute; right: 6px; bottom: 6px; display: none; padding: 2px 6px; background: rgba(15, 26, 51, .75); color: #fff; font-size: 11px; line-height: 1.4; border-radius: 2px; }
.asw-img.resizing .asw-img-size { display: block; }
.asw-img.asw-uploading img { opacity: .55; }
.asw-img.asw-uploading::after, .asw-img-ph::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2.5px solid rgba(46, 83, 146, .25); border-top-color: #2e5392; border-radius: 50%; animation: asw-spin .8s linear infinite; }
.asw-img-ph { position: relative; display: inline-block; width: 120px; height: 80px; border: 1px dashed #aab4c6; background: #f5f7fa; vertical-align: bottom; }
@keyframes asw-spin { to { transform: rotate(360deg); } }

/* HTML 소스 */
.asw-html { display: block; width: 100%; margin: 0; border: 0; outline: none; padding: 12px 14px; background: var(--asw-body-bg); font-family: Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.6; resize: vertical; color: #2b3344; }
.asw-html[hidden], .asw-body[hidden] { display: none; }

/* 하단 탭 (오른쪽 아래) */
.asw-modebar { display: flex; align-items: stretch; height: 26px; padding: 0 8px 0 0; background: var(--asw-tb-bg); border-top: 1px solid var(--asw-tb-line); border-radius: 0 0 calc(var(--asw-radius) - 1px) calc(var(--asw-radius) - 1px); }
.asw-tab { margin: -1px 0 0; padding: 0 14px; border: 1px solid transparent; border-top: 0; background: transparent; color: var(--asw-icon); opacity: .78; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .5px; cursor: pointer; border-radius: 0; }
.asw-tab:hover { opacity: 1; }
.asw-tab.on { background: var(--asw-body-bg); color: var(--asw-accent); border-color: var(--asw-tb-line); opacity: 1; }
.asw-theme-round .asw-tab.on { border-radius: 0 0 6px 6px; }
.asw-tab:focus { outline: none; }
.asw-tab:focus-visible { outline: 2px solid var(--asw-accent); outline-offset: -2px; }

/* 용량 초과 */
.asw-editor.asw-over { box-shadow: 0 0 0 2px #e2504d; }

/* ===== 레이어 공통 ===== */
.asw-layer { position: absolute; z-index: 1000; font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Noto Sans KR", sans-serif; font-size: 12.5px; color: #1f2733; line-height: 1.4; text-align: left; }
.asw-dd-menu, .asw-pop, .asw-palette, .asw-tgrid, .asw-menu { background: #fff; border: 1px solid #ccd2dc; border-radius: var(--asw-pop-radius, 2px); box-shadow: 0 6px 20px rgba(23, 41, 72, .16); }
.asw-dd-menu { padding: 3px; min-width: 132px; }
.asw-dd-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 9px; border: 0; background: transparent; border-radius: var(--asw-btn-radius, 2px); cursor: pointer; font: inherit; color: #333c4e; text-align: left; }
.asw-dd-item:hover { background: #eef3fc; color: #2e5392; }
.asw-dd-item.on { color: #2e5392; font-weight: 700; }
.asw-dd-item svg { width: 16px; height: 16px; flex: none; }

/* 색상표 */
.asw-palette { padding: 8px; width: 226px; }
.asw-pal-none { display: flex; align-items: center; gap: 7px; width: 100%; height: 26px; padding: 0 6px; margin-bottom: 6px; border: 1px solid #e1e5ec; background: #fff; border-radius: 2px; font: inherit; font-size: 12px; color: #333c4e; cursor: pointer; }
.asw-pal-none:hover { background: #f3f6fb; }
.asw-pal-noneico { width: 14px; height: 14px; border: 1px solid #c3c9d4; background: linear-gradient(to bottom right, transparent calc(50% - .8px), #e2504d 50%, transparent calc(50% + .8px)); }
.asw-pal-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.asw-pal-sw { width: 19px; height: 19px; padding: 0; border: 1px solid rgba(0, 0, 0, .12); border-radius: 1px; cursor: pointer; }
.asw-pal-sw.gap { margin-bottom: 5px; }
.asw-pal-sw:hover { transform: scale(1.18); border-color: #1f2733; position: relative; z-index: 1; }
.asw-pal-sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #2e5392; position: relative; z-index: 1; }
.asw-pal-foot { display: flex; align-items: center; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef0f4; }
.asw-pal-prev { flex: none; width: 22px; height: 22px; border: 1px solid #c3c9d4; }
.asw-pal-hex { flex: 1 1 auto; min-width: 0; height: 24px; padding: 0 6px; border: 1px solid #ccd2dc; border-radius: 2px; font: 12px Consolas, monospace; text-transform: uppercase; }
.asw-pal-hex.bad { border-color: #e2504d; }
.asw-pal-ok { flex: none; white-space: nowrap; height: 24px; padding: 0 9px; border: 0; border-radius: 2px; background: #2e5392; color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.asw-pal-more { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid #ccd2dc; border-radius: 2px; color: #50586a; cursor: pointer; overflow: hidden; }
.asw-pal-more input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }

/* 표 격자 */
.asw-tgrid { padding: 8px; }
.asw-tgrid-cells { display: grid; gap: 2px; }
.asw-tgrid-c { width: 17px; height: 17px; border: 1px solid #cdd3dd; background: #fff; cursor: pointer; }
.asw-tgrid-c.on { background: #dbe6f8; border-color: #4a7bd0; }
.asw-tgrid-label { margin-top: 6px; text-align: center; font-size: 12px; color: #4a5568; }

/* 이미지/링크 입력 팝업 */
.asw-pop { width: 300px; padding: 12px; }
.asw-ptabs { display: flex; gap: 0; margin: -12px -12px 12px; border-bottom: 1px solid #e3e6ec; }
.asw-ptab { flex: 1; height: 32px; border: 0; border-bottom: 2px solid transparent; background: transparent; font: inherit; font-size: 12.5px; color: #6b7690; cursor: pointer; }
.asw-ptab.on { color: #2e5392; border-bottom-color: #2e5392; font-weight: 700; }
.asw-field { display: block; margin-bottom: 10px; }
.asw-field-l { display: block; margin-bottom: 4px; font-size: 12px; color: #4a5568; }
.asw-input { display: block; width: 100%; height: 30px; padding: 0 8px; border: 1px solid #ccd2dc; border-radius: 2px; font: inherit; font-size: 12.5px; color: #1f2733; background: #fff; }
.asw-input:focus { outline: none; border-color: #4a7bd0; box-shadow: 0 0 0 2px rgba(74, 123, 208, .18); }
.asw-input.bad { border-color: #e2504d; }
.asw-filerow { display: flex; gap: 6px; margin-bottom: 10px; }
.asw-fname { flex: 1 1 auto; min-width: 0; height: 30px; line-height: 28px; padding: 0 8px; border: 1px solid #ccd2dc; border-radius: 2px; color: #6b7690; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.asw-pop-btns { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.asw-pbtn { height: 30px; padding: 0 12px; border: 1px solid #ccd2dc; border-radius: 2px; background: #fff; font: inherit; font-size: 12.5px; color: #333c4e; cursor: pointer; white-space: nowrap; }
.asw-pbtn:hover { background: #f3f6fb; }
.asw-pbtn.p { background: #2e5392; border-color: #2e5392; color: #fff; }
.asw-pbtn.p:hover { background: #24457c; }
.asw-pbtn.d { color: #c0392b; border-color: #efc4c0; }

/* 우클릭 메뉴 */
.asw-menu { padding: 3px; min-width: 190px; user-select: none; }
.asw-menu-item { position: relative; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: var(--asw-btn-radius, 2px); cursor: pointer; color: #2b3344; white-space: nowrap; }
.asw-menu-item:hover { background: #eef3fc; color: #2e5392; }
.asw-menu-item.off { color: #a7afbd; cursor: default; background: transparent; }
.asw-menu-item.off .asw-menu-ico { opacity: .45; }
.asw-menu-ico { width: 16px; height: 16px; flex: none; color: #50586a; display: inline-flex; }
.asw-menu-item:hover .asw-menu-ico { color: #2e5392; }
.asw-menu-ico svg { width: 16px; height: 16px; }
.asw-menu-label { flex: 1 1 auto; }
.asw-menu-chk { width: 14px; height: 14px; flex: none; }
.asw-menu-chk.on { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%232e5392' stroke-width='2.8'/%3E%3C/svg%3E") center / 14px no-repeat; }
.asw-menu-arrow { width: 0; height: 0; border-left: 4px solid #7a8496; border-top: 4px solid transparent; border-bottom: 4px solid transparent; flex: none; }
.asw-menu-sep { height: 1px; margin: 3px 4px; background: #e8ebf0; }
.asw-submenu { display: none; position: absolute; left: 100%; top: -4px; margin-left: 2px; z-index: 2; }
.asw-submenu.asw-sub-scroll { overflow-y: auto; overflow-x: hidden; }
.asw-submenu.flip { left: auto; right: 100%; margin: 0 2px 0 0; }
.asw-submenu.up { top: auto; bottom: -4px; }
.asw-menu-custom { padding: 0; min-width: 0; max-height: none; overflow: visible; }
.asw-menu-custom .asw-palette { border: 0; box-shadow: none; }
.asw-menu-item.has-sub:hover > .asw-submenu, .asw-menu-item.has-sub:focus-within > .asw-submenu { display: block; }

/* ===== F1 정보 화면 ===== */
.asw-about-overlay { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; background: rgba(15, 26, 51, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 20px; font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Noto Sans KR", sans-serif; }
.asw-about { position: relative; inline-size: 440px; max-inline-size: calc(100vw - 40px); padding: 32px 32px 20px; background: #fff; border-radius: 16px; text-align: center; color: #0f1a33; box-shadow: 0 20px 56px rgba(23, 41, 72, .32); box-sizing: border-box; }
.asw-about *, .asw-about *::before, .asw-about *::after { box-sizing: border-box; }
.asw-about:focus { outline: none; }
.asw-about-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: 0; background: transparent; color: #8592ab; font-size: 22px; line-height: 1; border-radius: 8px; cursor: pointer; }
.asw-about-x:hover { background: #eef1f6; color: #4a5875; }
.asw-about-x:focus { outline: none; }
.asw-about-x:focus-visible { outline: 2px solid #2e5392; outline-offset: 1px; }
.asw-about-logo { line-height: 0; }
.asw-about-logo svg { width: 92px; height: 92px; }
.asw-about-name { margin: 6px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.25; }
.asw-about-mark { color: #0f1a33; } .asw-about-sub { color: #2e5392; }
.asw-about-ver { display: inline-block; margin-top: 12px; padding: 3px 12px; border-radius: 999px; background: #eef3fc; color: #2e5392; font-size: 12px; font-weight: 700; }
.asw-about-info { margin: 18px 0 0; text-align: start; border-top: 1px solid #eef1f6; }
.asw-about-info > div { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 2px; border-bottom: 1px solid #eef1f6; font-size: 12.5px; }
.asw-about-info dt { width: 64px; flex: none; margin: 0; color: #6b7690; }
.asw-about-info dd { margin: 0; flex: 1; min-width: 0; color: #0f1a33; font-weight: 500; }
.asw-about-lic, .asw-about-sn, .asw-about-exp { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.asw-about-dom { word-break: break-all; }
.asw-about-sn code { font-family: Consolas, "Courier New", monospace; font-size: 11.5px; letter-spacing: -.2px; word-break: break-all; }
.asw-about-dash { color: #97a1b6; }
.asw-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.asw-pill.per { background: #eef3fc; color: #2e5392; }
.asw-pill.ent { background: #2e5392; color: #fff; }
.asw-pill.exp { background: #fdecec; color: #c0392b; }
.asw-about-copy { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #7a87a0; cursor: pointer; }
.asw-about-copy:hover { background: #eef1f6; color: #2e5392; }
.asw-about-copy.ok { color: #1f9d55; }
.asw-about-act { display: flex; gap: 10px; margin-top: 18px; }
.asw-about-btn { flex: 1; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; font-size: 13px; font-weight: 600; text-decoration: none; }
.asw-about-btn.p { background: #2e5392; color: #fff; } .asw-about-btn.p:hover { background: #172948; }
.asw-about-btn.s { background: #eef3fc; color: #2e5392; } .asw-about-btn.s:hover { background: #e2ecfb; }
.asw-about-foot { margin-top: 14px; font-size: 11px; color: #97a1b6; }
.asw-about-kbd { display: inline-block; padding: 1px 6px; border: 1px solid #cfd6e3; border-bottom-width: 2px; border-radius: 5px; font-size: 11px; font-weight: 600; color: #4a5875; }

/* ProseMirror 필수 규칙 */
.asw-content.ProseMirror { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-variant-ligatures: none; font-feature-settings: "liga" 0; }
.asw-content.ProseMirror pre { white-space: pre-wrap; }
.asw-content.ProseMirror li { position: relative; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection *::-moz-selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
.ProseMirror [draggable][contenteditable=false] { user-select: text; }
img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 1px !important; height: 1px !important; }
.asw-row-guide { position: fixed; height: 0; border-top: 2px solid #4a7bd0; z-index: 10000; pointer-events: none; }

/* ===== 1.0: TEXT 모드, 글자수, 경고창, 표 크기 ===== */
.asw-text { display: block; width: 100%; margin: 0; border: 0; outline: none; padding: 12px 14px; background: var(--asw-body-bg); color: var(--asw-text); font: inherit; font-size: inherit; line-height: var(--asw-lh, 1.0); resize: vertical; box-sizing: border-box; }
.asw-text[hidden] { display: none; }
.asw-fill > .asw-text { flex: 1 1 auto; min-height: 0; height: auto; }
.asw-text::placeholder { color: #9aa3b2; }
.asw-mode-text > .asw-toolbar, .asw-mode-html > .asw-toolbar { pointer-events: none; }
.asw-mode-text > .asw-toolbar > *, .asw-mode-html > .asw-toolbar > * { opacity: .38; }
.asw-counter { align-self: center; padding: 0 10px; font-size: 11px; color: var(--asw-icon); opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.asw-counter.full { color: #d23a3a; opacity: 1; font-weight: 700; }
.asw-dlg-wrap { position: absolute; inset: 0; z-index: 1001; display: flex; align-items: center; justify-content: center; padding: 12px; background: transparent; }
.asw-dlg { max-width: 380px; padding: 16px 16px 12px; background: #fff; border: 1px solid #ccd2dc; border-radius: var(--asw-pop-radius, 2px); box-shadow: 0 8px 26px rgba(23, 41, 72, .22); font-size: 13px; line-height: 1.55; color: #1f2733; }
.asw-dlg-msg { margin-bottom: 12px; white-space: pre-wrap; word-break: keep-all; }
.asw-dlg .asw-pop-btns { gap: 6px; }
.asw-tgrid-opts { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #e4e8ee; }
.asw-tgrid-f { display: flex; align-items: center; gap: 6px; }
.asw-tgrid-f > span:first-child { width: 30px; color: #4a5568; }
.asw-tgrid-f .asw-input { width: 86px; height: 24px; padding: 0 6px; }
.asw-tgrid-f .asw-input:disabled { background: #f1f3f6; color: #a0a7b4; }
.asw-tgrid-u { color: #7a8394; }
.asw-tgrid-full { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #2b3344; }
.asw-tgrid-full input { margin: 0; }
.asw-content table.asw-t100, .asw-view table[style*="width:100%"], .asw-view table[style*="width: 100%"] { width: 100% !important; }

/* ===== 1.1: 툴바 묶음 버튼, 더보기, 풍선 도움말 ===== */
.asw-toolbar { position: relative; flex-wrap: nowrap; overflow: hidden; }
.asw-toolbar.asw-wrap { flex-wrap: wrap; overflow: visible; }
.asw-toolbar > *, .asw-tb-overflow > * { flex: none; }
.asw-hide, .asw-btn[hidden] { display: none !important; }
.asw-split { display: inline-flex; align-items: center; border-radius: var(--asw-btn-radius); }
.asw-split:hover { box-shadow: inset 0 0 0 1px var(--asw-hover-bg); }
.asw-split > .asw-split-main { border-radius: var(--asw-btn-radius) 0 0 var(--asw-btn-radius); }
.asw-split > .asw-split-arrow { width: calc(var(--asw-btn) * .46); border-radius: 0 var(--asw-btn-radius) var(--asw-btn-radius) 0; }
.asw-split > .asw-split-arrow svg { width: 82%; height: 82%; opacity: .75; }
.asw-more { margin-left: auto; }
.asw-tb-overflow { position: absolute; right: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 1px; max-width: min(100%, 460px); padding: 4px 6px; background: #fff; background: var(--asw-tb-bg); border: 1px solid var(--asw-tb-line); border-top: 0; box-shadow: 0 8px 18px rgba(23, 41, 72, .16); border-radius: 0 0 var(--asw-pop-radius) var(--asw-pop-radius); }
.asw-tb-overflow[hidden] { display: none; }
.asw-tb-overflow .asw-sep { height: calc(var(--asw-btn) * .56); }
.asw-mode-text > .asw-tb-overflow, .asw-mode-html > .asw-tb-overflow { display: none; }
.asw-tip { position: fixed; z-index: 10002; max-width: 260px; padding: 5px 9px; background: #2b2f36; color: #f5f7fa; font: 500 12px/1.4 -apple-system, "Segoe UI", "Malgun Gothic", "Noto Sans KR", sans-serif; border-radius: 5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .22); pointer-events: none; opacity: 0; transform: translateY(-2px); transition: opacity .12s, transform .12s; white-space: nowrap; }
.asw-tip.show { opacity: 1; transform: none; }
.asw-tip::before { content: ""; position: absolute; left: var(--asw-tip-x, 50%); top: -4px; margin-left: -4px; border: 4px solid transparent; border-top: 0; border-bottom-color: #2b2f36; }
.asw-tip.up::before { top: auto; bottom: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: #2b2f36; }
.asw-dd-item:disabled { opacity: .4; cursor: default; background: transparent; }
.asw-dd-item > span:first-child:not(:only-child) { display: inline-flex; width: 18px; justify-content: center; }
.asw-dd-item > span[style] { width: 18px; text-align: center; font-size: 14px; flex: none; }

/* 본문 새 요소 */
.asw-content sup, .asw-view sup, .asw-content sub, .asw-view sub { font-size: .75em; line-height: 0; }
.asw-content h4, .asw-view h4 { font-size: 1.05em; margin: .4em 0; }
.asw-mention, .asw-tag { display: inline-block; padding: 0 4px; margin: 0 1px; border-radius: 3px; background: #e7effc; color: #2251a3; font-weight: 600; line-height: 1.35; }
.asw-tag { background: #eaf6ee; color: #1f7a45; }
.asw-fn { color: #2e5392; font-size: .75em; cursor: pointer; padding: 0 1px; }
.asw-content .asw-fn:hover { background: #e7effc; }
.asw-footnotes { margin-top: 18px; padding-top: 6px; border-top: 1px solid #d3d8e1; font-size: .88em; color: #4a5568; }
.asw-footnotes ol { margin: 4px 0; padding-left: 22px; }
.asw-toc { margin: 6px 0; padding: 8px 14px; border: 1px solid #d3d8e1; background: #f8fafd; border-radius: var(--asw-pop-radius, 2px); }
.asw-toc-t { font-weight: 700; margin-bottom: 4px; }
.asw-toc ul { margin: 0; padding-left: 18px; }
.asw-toc li { margin: 2px 0; } .asw-toc-2 { margin-left: 14px !important; } .asw-toc-3 { margin-left: 28px !important; }
.asw-toc a { color: #2e5392; text-decoration: none; }
.asw-content .asw-toc:empty::after { content: ""; }
.asw-media { position: relative; display: inline-block; max-width: 100%; margin: 6px 0; line-height: 0; }
.asw-media iframe, .asw-media video { max-width: 100%; display: block; border: 0; background: #000; }
.asw-media-cover { position: absolute; inset: 0; cursor: pointer; }
.asw-media.sel { outline: 2px solid #4a7bd0; }
.asw-view iframe, .asw-view video { max-width: 100%; border: 0; }
.asw-cols { column-gap: 2em; column-rule: 1px dashed transparent; margin: 6px 0; }
.asw-content .asw-cols { column-rule-color: #d5dbe5; outline: 1px dashed #dfe4ec; outline-offset: 2px; }
.asw-box { border: 1px solid #b9c3d3; padding: 8px 12px; margin: 6px 0; }
.asw-content td[style*="hidden"], .asw-content th[style*="hidden"] { outline: 1px dashed #cfd5df; outline-offset: -1px; }
.asw-content .ProseMirror-selectednode.tableWrapper, .asw-content table.ProseMirror-selectednode { outline: 2px solid #4a7bd0; }
.asw-hit { background: #ffe58a; border-radius: 2px; }
.asw-hit.cur { background: #ffa33a; }
.asw-painting .asw-content { cursor: copy; }

/* 표 선택·이동 핸들 */
.asw-thandle { position: absolute; z-index: 5; width: 18px; height: 18px; padding: 0; border: 1px solid #9fb3d6; border-radius: 3px; background: #fff; color: #2e5392; cursor: move; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(23, 41, 72, .15); }
.asw-thandle svg { width: 13px; height: 13px; }
.asw-thandle:hover { background: #2e5392; color: #fff; border-color: #2e5392; }
.asw-thandle[hidden] { display: none; }

/* 찾기 / 바꾸기 */
.asw-find { position: absolute; right: 8px; top: calc(var(--asw-btn) + 12px); z-index: 45; width: 330px; max-width: calc(100% - 16px); padding: 8px; background: #fff; border: 1px solid #ccd2dc; border-radius: var(--asw-pop-radius, 2px); box-shadow: 0 6px 20px rgba(23, 41, 72, .16); font-size: 12.5px; color: #1f2733; }
.asw-find[hidden] { display: none; }
.asw-find-row { display: flex; align-items: center; gap: 4px; margin-bottom: 5px; }
.asw-find-row:last-child { margin-bottom: 0; }
.asw-find .asw-input { flex: 1 1 auto; min-width: 0; height: 28px; }
.asw-find .asw-pbtn { height: 28px; padding: 0 9px; }
.asw-find-n { min-width: 46px; text-align: center; color: #6b7690; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.asw-find-n.none { color: #d23a3a; }
.asw-find-x { width: 26px; height: 26px; border: 0; background: transparent; font-size: 18px; color: #7a8496; cursor: pointer; border-radius: 3px; }
.asw-find-x:hover { background: #eef1f6; }
.asw-find-cs { display: inline-flex; align-items: center; gap: 5px; color: #4a5568; cursor: pointer; }
.asw-find-cs input { margin: 0; }

/* 멘션 후보 */
.asw-suggest { position: absolute; z-index: 1000; min-width: 200px; max-width: 300px; max-height: 240px; overflow: auto; padding: 3px; background: #fff; border: 1px solid #ccd2dc; border-radius: var(--asw-pop-radius, 2px); box-shadow: 0 6px 20px rgba(23, 41, 72, .16); font-size: 12.5px; }
.asw-suggest[hidden] { display: none; }
.asw-sg-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 9px; border-radius: 2px; cursor: pointer; color: #2b3344; }
.asw-sg-item.on { background: #eef3fc; color: #2e5392; }
.asw-sg-s { color: #8a94a6; font-size: 11.5px; }
.asw-sg-empty { padding: 7px 9px; color: #8a94a6; }

/* 특수문자 */
.asw-chars { width: 336px; }
.asw-chars-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; max-height: 210px; overflow: auto; }
.asw-chars-grid.emoji { grid-template-columns: repeat(10, 1fr); }
.asw-char { height: 25px; padding: 0; border: 1px solid transparent; background: #fff; border-radius: 2px; font: 15px "Segoe UI", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; color: #1f2733; cursor: pointer; }
.asw-chars-grid.emoji .asw-char { font-size: 18px; height: 30px; }
.asw-char:hover { border-color: #4a7bd0; background: #eef3fc; }
.asw-ta { height: 72px; padding: 6px 8px; resize: vertical; line-height: 1.5; }
.asw-pop-err { margin: -4px 0 8px; color: #d23a3a; font-size: 12px; }

/* 그림판 */
.asw-draw-ov { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; background: rgba(15, 26, 51, .38); padding: 16px; font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Noto Sans KR", sans-serif; font-size: 12.5px; }
.asw-draw { max-width: 100%; padding: 12px; background: #fff; border-radius: 8px; box-shadow: 0 20px 56px rgba(23, 41, 72, .32); }
.asw-draw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; }
.asw-draw-t { width: 30px; height: 30px; border: 1px solid #d5dae2; background: #fff; border-radius: 4px; font-size: 15px; cursor: pointer; color: #2b3344; }
.asw-draw-t.on { background: #2e5392; border-color: #2e5392; color: #fff; }
.asw-draw-c { width: 22px; height: 22px; padding: 0; border: 1px solid rgba(0, 0, 0, .2); border-radius: 50%; cursor: pointer; }
.asw-draw-c.on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #2e5392; }
.asw-draw-pick { width: 28px; height: 26px; padding: 0; border: 1px solid #d5dae2; background: #fff; cursor: pointer; }
.asw-draw-size { height: 28px; border: 1px solid #ccd2dc; font: inherit; }
.asw-draw-sep { width: 1px; height: 20px; background: #dfe3ea; margin: 0 4px; }
.asw-draw-cv { display: block; max-width: 100%; border: 1px solid #d5dae2; cursor: crosshair; touch-action: none; background: #fff; }
.asw-draw .asw-pop-btns { margin-top: 10px; }

/* 전체 화면 */
html.asw-noscroll, html.asw-noscroll body { overflow: hidden; }
.asw-editor.asw-fullscreen { position: fixed; inset: 0; z-index: 9000; width: auto !important; height: auto !important; display: flex; flex-direction: column; border-radius: 0; margin: 0; }
.asw-fullscreen > .asw-body, .asw-fullscreen > .asw-html, .asw-fullscreen > .asw-text { flex: 1 1 auto; height: auto !important; min-height: 0 !important; overflow: auto; }
.asw-fullscreen > .asw-body > .asw-content { max-width: 960px; width: 100%; margin: 0 auto; }
