/* SOJANG Figma W09-W17, W21-W22 and P08: editor layout parity.
   Original editor.js, autosave, publication permissions and secure API remain intact. */
body.editor-mode{background:#fcf8f2;color:#342d39}
.editor-mode .editor-layout{display:grid!important;grid-template-columns:210px minmax(360px,1fr) 205px!important;grid-template-rows:80px minmax(0,1fr)!important;grid-template-areas:"top top top" "sidebar stage inspector"!important;gap:16px!important;height:100dvh!important;max-height:100dvh!important;min-height:100dvh!important;padding:0 16px 16px;background:#fcf8f2;overflow:hidden}
.editor-mode .editor-workspace{display:contents!important}
.editor-mode .editor-header{grid-area:top;min-height:80px!important;height:80px!important;border:0!important;background:#fffefc!important;border-radius:0 0 12px 12px;padding:15px 18px!important;position:relative;z-index:50;display:flex;align-items:center;gap:15px;box-shadow:0 1px 5px #43334208}
.editor-mode .sj-editor-back{display:inline-flex;align-items:center;justify-content:center;flex:0 0 160px;height:48px;padding:10px 20px;border:1px solid #ae96a5;border-radius:6px;background:#fffefc;color:#784963;font:500 14px "Noto Sans KR",sans-serif;text-decoration:none}
.editor-mode .sj-editor-back:hover{background:#f5ebf1}
.editor-mode .sj-editor-title{display:block;min-width:0;flex:1;font:600 18px/1.5 "Noto Sans KR",sans-serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#342d39}
.editor-mode .editor-breadcrumb{display:none}
.editor-mode .editor-header-actions{flex:0 0 auto;display:flex;align-items:center;gap:10px;position:relative}
.editor-mode .editor-header-actions .save-indicator{display:inline-flex;align-items:center;gap:5px;color:#33654c;background:#eff3ed;padding:8px 11px;font:500 12px/1.5 "Noto Sans KR",sans-serif;border-radius:3px;white-space:nowrap}
.editor-mode .save-indicator:before{content:'✓ ';display:inline}
.editor-mode .editor-header-actions .button-dark{width:160px!important;min-height:48px!important;background:#784963!important;color:#fffefc!important;border:1px solid #784963!important;border-radius:6px!important;font-size:14px!important}
.editor-mode #sjEditorToolsButton{min-height:44px;min-width:100px;border:1px solid #ae91a0!important;background:#fff!important;color:#784963!important}
.editor-mode #editorMobileMore{display:none!important}
.editor-mode .sj-editor-extra-tools{position:absolute;right:0;top:calc(100% + 13px);width:min(342px,calc(100vw - 32px));max-height:73dvh;overflow-y:auto;display:none;flex-direction:column;gap:8px;padding:16px;background:#fffefc;border:1px solid #d8c7d2;border-radius:12px;box-shadow:0 12px 32px #40334025;z-index:100}
.editor-mode .sj-editor-extra-tools.is-open{display:flex}
.editor-mode .sj-editor-extra-tools>a,.editor-mode .sj-editor-extra-tools>button{width:100%;display:flex!important;align-items:center;justify-content:center;min-height:44px;border:1px solid #bda3b3!important;border-radius:6px;padding:8px;background:#fff!important;color:#784963!important;text-align:center;font-size:13px;text-decoration:none}
.editor-mode .sj-editor-extra-tools .sojang-studio-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
.editor-mode .sj-editor-extra-tools .sojang-studio-shortcuts a{display:flex;align-items:center;justify-content:center;padding:10px;border:1px solid #d7c7d0;border-radius:6px;color:#784963;white-space:normal}
.editor-mode .editor-sidebar{grid-area:sidebar;display:flex!important;flex-direction:column;min-height:0;max-height:100%;border:0!important;border-radius:12px;background:#fffefc!important;box-shadow:0 2px 5px #45334209;overflow:auto;padding:12px!important}
.editor-mode .editor-sidebar .editor-side-top{padding:4px 4px 17px;margin-bottom:10px;border:0}
.editor-mode .editor-side-top .back-link,.editor-mode .editor-side-top .side-kicker,.editor-mode .editor-side-top h2,.editor-mode .editor-side-top p{display:none}
.editor-mode .editor-sidebar .sidebar-label{padding:2px 4px 10px;font:600 16px/1.5 "Noto Sans KR",sans-serif;color:#342d39;letter-spacing:0}
.editor-mode .editor-sidebar .tiny-plus{width:auto;height:40px;min-width:74px;padding:8px;border:1px solid #af96a8;border-radius:6px;background:#fffefc;color:#784963;font-size:17px}
.editor-mode .editor-outline{overflow-y:auto;padding:0!important;flex:1}
.editor-mode .sojang-outline-group{padding:12px 3px 14px;border:0}
.editor-mode .chapter-name-btn{font:600 12px "Noto Sans KR",sans-serif;color:#342d39}
.editor-mode .editor-outline :is(button,a){border-radius:6px}
.editor-mode .outline-page.active,.editor-mode .outline-page:has(.page-select[aria-current="page"]){background:#f2e9ef!important}
.editor-mode .editor-sidebar .sidebar-add,.editor-mode .sojang-continuous-edit-link{margin:7px 4px;display:flex;align-items:center;justify-content:center;background:#fffefc!important;border:1px solid #bca2b1!important;color:#784963!important;border-radius:6px!important;min-height:41px;font:500 12px "Noto Sans KR",sans-serif;text-align:center;padding:9px}
.editor-mode .editor-sidebar .sidebar-tip{border:0;color:#625865;font-size:11px}
.editor-mode .sj-editor-body{grid-area:stage;display:flex;flex-direction:column;gap:12px;overflow:auto;min-width:0;min-height:0;border-radius:12px;background:#fcf8f2}
.editor-mode .sj-editor-mobile-tools{display:none}
.editor-mode .editor-toolbar{display:flex!important;align-items:center;gap:9px!important;min-height:61px;padding:8px 14px!important;background:#fffefc;border:0!important;border-radius:12px;box-shadow:0 2px 7px #45334208;flex:none}
.editor-mode .editor-toolbar .toolbar-hint{font-size:11px;color:#625865}
.editor-mode .sj-editor-format-open{display:inline-flex;align-items:center;justify-content:center;min-height:42px;min-width:95px;margin-left:auto;border:1px solid #ae94a3;border-radius:6px;background:#fffefc;color:#784963;font:500 12px "Noto Sans KR",sans-serif;order:99}
.editor-mode .editor-canvas{flex:1;min-height:0;min-width:0;padding:14px!important;overflow:auto;background:linear-gradient(120deg,#f9f3ed,#fcf8f2 48%,#f2e9e4)!important;align-items:center;justify-content:flex-start}
.editor-mode .editor-paper-shell{display:flex;gap:12px;align-items:stretch;justify-content:center;min-height:0;filter:none!important;max-width:100%;margin:0 auto}
.editor-mode .editor-paper,.editor-mode .sojang-next-editor-paper{width:min(365px,calc((100vw - 520px)/2))!important;min-width:0!important;background:linear-gradient(90deg,#f2e9df,#fffefc 7%,#fffefc 93%,#efe4d8)!important;box-shadow:1px 4px 12px #55445121;padding:30px 27px 23px!important;color:#342d39!important;overflow:hidden;border:0;border-radius:4px!important}
.editor-mode .paper-content{font-family:"Noto Serif KR","AppleMyungjo",serif!important;line-height:var(--editor-line,2)!important;color:#342d39}
.editor-mode .paper-kicker{border:0;font-size:12px;color:#625865}
.editor-mode .paper-footer{border:0;color:#625865}
.editor-mode .page-navigation{display:flex;justify-content:flex-end;gap:12px!important;margin:0!important;padding:7px 5px 0}
.editor-mode .page-navigation button{min-height:43px;border:1px solid #b29aaa;border-radius:6px;background:#fffefc!important;color:#784963!important;font:500 12px "Noto Sans KR",sans-serif;padding:10px 17px}
.editor-mode .editor-bottom{border:0;background:transparent;color:#625865;font-size:11px;padding:9px}
.editor-mode .editor-inspector{grid-area:inspector;display:flex;flex-direction:column;min-height:0;max-height:100%;background:#fffefc!important;border:0!important;border-radius:12px;padding:20px 13px!important;overflow:auto}
.editor-mode .editor-inspector .side-kicker{font:600 16px "Noto Sans KR",sans-serif;color:#342d39;letter-spacing:0}
.editor-mode .editor-inspector .inspector-cover{display:none}
.editor-mode .editor-inspector h3{font:600 16px/1.5 "Noto Sans KR",sans-serif;color:#342d39}
.editor-mode .editor-inspector p{font-size:12px}
.editor-mode .editor-inspector .sojang-book-control{display:grid;gap:8px}
.editor-mode .editor-inspector .sojang-book-control .button{width:100%;min-height:41px;border:1px solid #ae91a3!important;background:#fffefc!important;color:#784963!important;border-radius:6px;font-size:12px;padding:9px}
.editor-mode .editor-inspector .export-button{min-height:44px;background:#fff!important;border:1px solid #bea5b5;border-radius:6px;color:#784963}
.editor-mode .sj-editor-format-dialog{width:min(560px,calc(100vw - 32px));background:#fffefc!important}
.editor-mode .sj-editor-format-dialog .modal-form{display:block;padding:24px}
.editor-mode .sj-editor-format-dialog #manuscriptFormatForm{border:0;background:#fff;padding:0;display:block;width:100%;margin:0}
.editor-mode .sj-editor-format-dialog .sojang-manuscript-format-heading{display:none}
.editor-mode .sj-editor-format-dialog #manuscriptFormatFields{display:flex!important;flex-direction:column;gap:12px;background:transparent;padding:0;border:0;margin:0}
.editor-mode .sj-editor-format-dialog #manuscriptFormatFields label{display:flex;flex-direction:column;gap:7px;font:500 14px "Noto Sans KR",sans-serif;color:#342d39;width:100%}
.editor-mode .sj-editor-format-dialog #manuscriptFormatFields :is(input,select){width:100%;min-height:44px;border-radius:7px;border:1px solid #ac93a5;background:#fffefc;padding:10px 12px;font-size:14px;color:#342d39}
.editor-mode .sj-editor-format-dialog #manuscriptFormatSave{min-height:46px;background:#784963!important;color:#fff!important;border:1px solid #784963!important}
.editor-mode .sj-editor-format-dialog #manuscriptFormatReset{min-height:46px;border:1px solid #ae92a4;color:#784963!important;background:#fff!important}
.editor-mode .sj-editor-format-dialog .sojang-manuscript-format-status{font-size:12px;color:#625865}
.editor-mode #sjEditorMobileToc{display:none}
@media(min-width:901px) and (max-width:1240px){
 .editor-mode .editor-layout{grid-template-columns:188px minmax(345px,1fr) 175px!important;gap:10px;padding:0 10px 10px}
 .editor-mode .sj-editor-back{flex-basis:100px}
 .editor-mode .editor-paper,.editor-mode .sojang-next-editor-paper{width:min(330px,calc((100vw - 430px)/2))!important}
}
@media(max-width:900px){
 .editor-mode .editor-layout{grid-template-columns:180px minmax(0,1fr)!important;grid-template-areas:"top top" "sidebar stage"!important}
 .editor-mode .editor-inspector{display:none}
 .editor-mode .editor-paper,.editor-mode .sojang-next-editor-paper{width:min(320px,calc((100vw - 290px)/2))!important}
 .editor-mode .sj-editor-back{flex-basis:100px}
}
@media(max-width:700px){
 .editor-mode,.editor-mode body{background:#fcf8f2!important}
 .editor-mode .editor-layout{display:flex!important;flex-direction:column!important;height:100dvh!important;max-height:100dvh!important;min-height:100dvh!important;padding:0 0 60px!important;gap:0!important;overflow:hidden!important}
 .editor-mode .editor-workspace{display:flex!important;flex-direction:column!important;height:100%;min-height:0;overflow:hidden}
 .editor-mode .editor-header{height:75px!important;min-height:75px!important;border-radius:0 0 10px 10px;gap:8px;padding:9px 16px!important;flex:0 0 75px;position:relative;z-index:50}
 .editor-mode .sj-editor-back{flex:0 0 120px;height:43px;min-height:43px;font-size:12px}
 .editor-mode .sj-editor-title{display:none}
 .editor-mode .editor-header-actions .save-indicator{font-size:11px;max-width:145px;white-space:nowrap}
 .editor-mode .editor-header-actions #publishButton{display:none}
 .editor-mode .editor-header-actions #saveButton{display:none}
 .editor-mode #sjEditorToolsButton{min-width:42px;font-size:11px;padding:7px!important}
 .editor-mode .sj-editor-extra-tools{right:0;top:calc(100% + 10px)}
 .editor-mode .sj-editor-body{display:flex!important;flex:1;min-height:0;min-width:0;gap:10px;padding:16px!important;overflow:hidden!important;background:#fcf8f2}
 .editor-mode .sj-editor-mobile-tools{display:grid;grid-template-columns:1fr 1fr;gap:12px;flex:0 0 48px}
 .editor-mode .sj-editor-mobile-tools button{min-width:0;min-height:48px;background:#fffefc;border:1px solid #b69cac;border-radius:8px;color:#784963;font-size:14px}
 .editor-mode .editor-toolbar{display:none!important}
 .editor-mode .editor-canvas{display:flex;flex-direction:column!important;flex:1;min-height:0!important;width:100%;height:auto!important;margin:0!important;padding:0!important;background:#fcf8f2!important;overflow:hidden!important}
 .editor-mode .editor-paper-shell{width:100%!important;height:100%!important;flex:1;min-height:0;max-height:none;display:block!important;overflow:hidden}
 .editor-mode .editor-paper{width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;padding:27px 24px!important;background:linear-gradient(90deg,#eee4da,#fffefc 6%,#fffefc 94%,#eee3db)!important;box-shadow:0 2px 13px #65435418!important}
 .editor-mode .sojang-next-editor-paper{display:none!important}
 .editor-mode .paper-content{font-size:16px;line-height:1.95!important}
 .editor-mode .page-navigation{position:fixed;bottom:0;left:0;right:0;z-index:90;margin:0!important;padding:7px 16px;background:#fffefc;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:center}
 .editor-mode .page-navigation .page-count-label{grid-column:1 / -1;grid-row:1;text-align:center;font-size:11px}
 .editor-mode .page-navigation button{min-width:0;padding:7px 5px;min-height:43px;font-size:11px}
 .editor-mode #nextPageButton{grid-column:1}
 .editor-mode #deleteManuscriptPageButton{grid-column:2}
 .editor-mode #prevPageButton{grid-column:3}
 .editor-mode .editor-bottom{display:none}
 .editor-mode .editor-sidebar{display:none!important}
 .editor-mode .editor-sidebar.sj-mobile-open{display:flex!important;position:fixed;inset:75px 0 64px auto;width:min(295px,90vw);max-width:none;max-height:none;z-index:99;border:1px solid #d3c2cd!important;border-radius:12px 0 0 12px;box-shadow:-7px 7px 25px #45304124;padding:15px!important;overflow-y:auto}
 .editor-mode #sjEditorMobileToc{display:block}
 .editor-mode .sj-editor-format-dialog{width:calc(100vw - 32px);max-width:342px}
 .editor-mode .sj-editor-format-dialog .modal-form{padding:18px}
}

/* W09 owns the viewport; do not stack the public site navbar above its Figma header. */
body.editor-mode>.topbar,body.editor-mode>.site-footer{display:none!important}
@media(min-width:1251px){
 .editor-mode .editor-paper,.editor-mode .sojang-next-editor-paper{width:min(410px,calc((100vw - 535px)/2))!important}
}
