@font-face{font-family:SBSystem;src:local('Pretendard Variable'),local('Malgun Gothic')}

:root{
  color-scheme:light;
  --bg:#f7f6fa;
  --panel:#fff;
  --ink:#282133;
  --muted:#786b85;
  --line:#e5dfed;
  --accent:#6c2edd;
  --accent-soft:#f2ebff;
  --radius:16px;
}
*{box-sizing:border-box}
html{min-width:0}
body{margin:0;background:var(--bg);color:var(--ink);font-family:SBSystem,Pretendard,-apple-system,BlinkMacSystemFont,'Segoe UI','Malgun Gothic',sans-serif;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea,summary{touch-action:manipulation}
button,.button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:42px;padding:9px 15px;border:1px solid #ddd5e9;border-radius:10px;background:#fff;color:#433450;font-weight:650;line-height:1.5;text-align:center;cursor:pointer;overflow-wrap:anywhere;transition:background-color .15s,border-color .15s,box-shadow .15s}
button:disabled{opacity:.48;cursor:not-allowed}
.primary{border-color:var(--accent);background:var(--accent);color:#fff;box-shadow:0 4px 10px #6c2edd1a}
.quiet{background:#fff}
a{color:#6230c4;text-underline-offset:3px}
a.button{text-decoration:none}
input,textarea,select{display:block;width:100%;max-width:100%;min-width:0;min-height:43px;padding:10px 11px;border:1px solid #d8cfe3;border-radius:9px;background:#fff;color:var(--ink);font-size:14px;line-height:1.5;transition:border-color .15s,box-shadow .15s}
input::placeholder,textarea::placeholder{color:#97879f}
input:focus,textarea:focus,select:focus{border-color:#9d77df;box-shadow:0 0 0 3px #6c2edd0c}
input:disabled,textarea:disabled,select:disabled{color:#84788e;background:#f7f5fa}
input[type=color]{height:43px;padding:4px}
input[type=file]{padding:9px;font-size:12px;overflow:hidden}
input[type=file]::file-selector-button{margin-right:8px;padding:5px 8px;border:0;border-radius:6px;background:var(--accent-soft);color:#6534ac;font:inherit;font-weight:650;cursor:pointer}
textarea{resize:vertical;line-height:1.65}
label{display:block;min-width:0;margin:0 0 16px;color:#53445f;font-size:12px;font-weight:650;overflow-wrap:anywhere}
label input,label textarea,label select{margin-top:6px;font-weight:400}
fieldset{min-width:0;margin:0;padding:0;border:0}
legend{max-width:100%;margin:10px 0 14px;padding:0;color:#4a385a;font-size:16px;font-weight:750}
input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #9560ed;outline-offset:3px}
h1,h2,h3,p{overflow-wrap:anywhere}
h1{margin:0 0 8px;font-size:27px;font-weight:780;line-height:1.3;letter-spacing:-.045em}
h2{margin:0 0 12px;font-size:18px;font-weight:750;line-height:1.4;letter-spacing:-.03em}
p{margin:0 0 14px}
.muted{color:var(--muted);font-size:13px}
.eyebrow{margin:0 0 9px;color:#8050cb;font-size:10px;font-weight:750;line-height:1.5;letter-spacing:.12em}

/* The header stays compact while account controls can wrap at larger text sizes. */
.topbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 24px;min-height:72px;padding:14px 28px;border-bottom:1px solid var(--line);background:#fff}
.brand{display:inline-flex;align-items:center;gap:10px;min-width:0;color:#2c2039;font-size:20px;font-weight:800;line-height:1.35;letter-spacing:-.04em;text-decoration:none}
.brand-mark{display:grid;place-items:center;flex:none;min-width:38px;min-height:38px;padding:5px 11px;border-radius:12px;background:var(--accent);color:#fff;font-size:22px;font-weight:850;line-height:1.25;box-shadow:0 4px 10px #6c2edd21}
.brand-copy{display:grid;min-width:0;gap:1px}
.brand-copy strong{font-size:18px;line-height:1.35;letter-spacing:-.035em}
.brand-copy small{color:#786b85;font-size:10px;font-weight:500;line-height:1.4;letter-spacing:.015em}
.brand>span:not(.brand-mark):not(.brand-copy){margin-left:5px;padding-left:12px;border-left:1px solid var(--line);color:var(--muted);font-size:12px;font-weight:500;letter-spacing:0}
.top-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px 16px;min-width:0;max-width:100%;color:var(--muted);font-size:12px}
.top-actions a{color:#776788;text-decoration:none}
.top-actions button{min-height:34px;padding:6px 11px;font-size:12px}
#account-label{max-width:100%;padding:4px 9px;border-radius:7px;background:#f6f3fa;color:#7b638f;font-size:11px}
#main{max-width:1800px;margin:0 auto;padding:24px 28px 28px}

.workspace-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:14px 24px;margin-bottom:19px}
.workspace-heading{flex:1 1 240px;min-width:0}
.workspace-head h1{margin:0;font-size:26px;line-height:1.35}
.workspace-head .muted{margin:5px 0 0;font-size:12px}
.workspace-head .eyebrow{margin-bottom:5px}
.workflow-chips{display:flex;align-items:center;flex-wrap:wrap;gap:7px;min-width:0;max-width:100%;color:#796487;font-size:11px}
.workflow-chips span{max-width:100%;padding:6px 10px;border:1px solid #e7def1;border-radius:8px;background:#fcfaff;line-height:1.4}
.workflow-chips span:first-child{border-color:#dbc9f3;background:#f0e7ff;color:#743dc7;font-weight:700}
.workflow-chips b{display:inline-flex;align-items:center;justify-content:center;min-width:18px;min-height:18px;margin-right:4px;padding:0 4px;border-radius:5px;background:#fff;color:#7b48bf;font-size:10px;line-height:1.5}
.view-tabs{display:flex;flex-wrap:wrap;gap:4px;min-width:0;max-width:100%;padding:4px;border:1px solid #e7dfef;border-radius:11px;background:#ede8f3}
.view-tabs button{flex:1 1 auto;min-height:36px;padding:7px 12px;border:0;background:transparent;color:#786487;font-size:12px;box-shadow:none}
.view-tabs button[aria-pressed=true]{background:#fff;color:#6730c6;box-shadow:0 2px 5px #2e144b0c}

.editor-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:11px 16px;min-width:0;margin-bottom:17px;padding:13px 15px;border:1px solid var(--line);border-radius:var(--radius);background:#fff;box-shadow:0 3px 9px #33204403}
.page-picker{display:flex;align-items:center;flex-wrap:wrap;gap:7px 10px;flex:1 1 330px;min-width:0;margin:0;color:#786487;font-size:12px;font-weight:600}
.page-picker select{flex:1 1 220px;width:100%;max-width:360px;min-width:0;min-height:40px;margin:0;padding:8px 32px 8px 11px;border-color:#e3d9ee;background-color:#fcfaff;color:#4b345e;font-size:13px;font-weight:650}
.page-count{display:inline-flex;align-items:center;justify-content:center;flex:none;max-width:100%;padding:5px 9px;border-radius:7px;background:#f4effa;color:#7c5f98;font-size:10px;font-weight:700;line-height:1.6}
#save-state,.save-state{flex:0 1 auto;min-width:0;margin:0;color:#82708f;font-size:11px;line-height:1.6}
.toolbar-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;flex:0 1 auto;min-width:0;margin-left:auto}
.toolbar-actions button{font-size:12px}
.toolbar-actions .primary{padding-inline:18px}
.editor-grid{display:grid;grid-template-columns:330px minmax(0,1fr);gap:18px;align-items:start;min-width:0}
.controls{min-width:0;max-height:calc(100vh - 295px);max-height:max(340px,calc(100dvh - 295px));padding:19px;border:1px solid var(--line);border-radius:var(--radius);background:#fff;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#d8cbe6 transparent;scrollbar-gutter:stable}
.controls-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;margin-bottom:17px}
.controls-head h2{margin:0;color:#443050;font-size:15px;line-height:1.45}
.controls-head small{color:#82708f;font-size:10px;line-height:1.5}
.controls label{font-size:12px}
.design-controls{margin-bottom:16px;padding:0 0 14px;border-bottom:1px solid #eee7f5}
.design-controls>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:40px;padding:6px 9px;border-radius:9px;background:#f8f5fc;color:#76608a;font-size:12px;font-weight:650;line-height:1.5;list-style:none;cursor:pointer}
.design-controls>summary::after{content:'+';flex:none;color:#8c69ab;font-size:17px;font-weight:400;line-height:1}
.design-controls[open]>summary::after{content:'\2212'}
.design-controls>summary::-webkit-details-marker{display:none}
.design-controls fieldset{padding-top:15px}
.design-controls fieldset>label:last-child,.design-controls #business-fields>label:last-child{margin-bottom:1px}
.section-picker{margin-bottom:10px;color:#80668f;font-size:11px}
.section-picker select{border-color:#dbcceb;background:#fdfbff;color:#684582;font-size:12px;font-weight:650}
.section-order{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 17px}
.section-order button{flex:1 1 90px;min-width:0;min-height:34px;padding:6px 8px;border-color:#e8dfef;color:#80668f;font-size:11px;font-weight:550}
#fields{display:grid;gap:9px;min-width:0}
.field-row{min-width:0;margin:0;border:1px solid #e9e1f1;border-radius:11px;background:#fff;overflow:clip;transition:border-color .15s,box-shadow .15s}
.field-row.selected{border-color:#996de0;box-shadow:0 0 0 3px #6c2edd0e}
.field-row:focus-within{border-color:#a07ae2;box-shadow:0 0 0 3px #6c2edd10}
.field-summary{display:grid;grid-template-columns:auto minmax(0,1fr) 13px;align-items:center;gap:9px;min-width:0;min-height:48px;padding:11px 10px;list-style:none;cursor:pointer}
.field-summary::-webkit-details-marker{display:none}
.field-summary::after{content:'\2304';color:#957ba4;font-size:16px;line-height:1;transform-origin:center}
.field-row[open]>.field-summary{border-bottom:1px solid #eee7f5;background:#fcfaff}
.field-row[open]>.field-summary::after{transform:rotate(180deg)}
.field-row.selected>.field-summary{background:#f5efff}
.field-kind{display:inline-flex;align-items:center;justify-content:center;min-width:0;max-width:100%;padding:3px 6px;border-radius:5px;background:#f0e7fc;color:#7849af;font-size:10px;font-weight:700;line-height:1.5}
.field-summary-text{display:-webkit-box;min-width:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#6d587e;font-size:12px;font-weight:550;line-height:1.65;overflow-wrap:anywhere}
.field-body{min-width:0;padding:13px 12px 1px}
.field-body label{margin-bottom:13px;color:#7e6390;font-size:11px;font-weight:600}
.field-body input,.field-body textarea{margin-top:6px;border-color:#e1d6eb;background:#fff;font-size:13px;line-height:1.7}
.field-body textarea{min-height:92px}
.field-image{display:block;width:100%;max-width:100%;max-height:155px;margin:7px 0 10px;border:1px solid #eee6f5;border-radius:8px;background:#f7f3fb;object-fit:contain}
.field-tip{display:block;margin-top:6px;color:#877393;font-size:10px;font-weight:400;line-height:1.65}
#request-note-label{margin:19px 0 0;padding-top:16px;border-top:1px solid #eee7f4;color:#80668f;font-size:11px}
#request-note-label textarea{min-height:86px;font-size:12px}

.preview-panel{min-width:0;border:1px solid #ddd4e8;border-radius:var(--radius);background:#eee9f5;overflow:hidden;box-shadow:0 5px 16px #31204405}
.preview-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 14px;min-width:0;padding:14px 18px;border-bottom:1px solid #e7def0;background:#fff}
.preview-head>div:first-child{display:grid;gap:1px;flex:1 1 150px;min-width:0}
.preview-head strong{color:#625070;font-size:12px;font-weight:700;line-height:1.5}
.preview-head small{max-width:100%;color:#877093;font-size:10px;line-height:1.5;overflow-wrap:anywhere}
.preview-width{display:flex;align-items:center;flex-wrap:wrap;gap:3px;max-width:100%;padding:3px;border:1px solid #eee6f5;border-radius:9px;background:#f8f4fc}
.preview-width button{flex:1 1 auto;min-width:0;min-height:30px;padding:4px 11px;border-color:transparent;border-radius:6px;background:transparent;color:#87699e;font-size:11px;font-weight:650}
.preview-width button[aria-pressed=true]{border-color:#dfccef;background:#fff;color:#794ab3;box-shadow:0 2px 4px #48256806}
.preview-hint{margin:0;padding:9px 17px;border-bottom:1px solid #e7def0;background:#f7f3fb;color:#897094;font-size:11px;line-height:1.7}
.preview-wrap{width:100%;max-width:100%;margin:0 auto;background:#fff;transition:max-width .15s}
.preview-wrap.mobile{max-width:390px;border-inline:1px solid #d8cfe4}
iframe{display:block;width:100%;min-width:0;height:calc(100vh - 400px);height:max(430px,calc(100dvh - 400px));min-height:430px;border:0;background:#fff}

.auth-card{width:100%;max-width:440px;margin:clamp(30px,7vh,90px) auto;padding:34px;border:1px solid #e4dced;border-radius:20px;background:#fff;box-shadow:0 12px 35px #3e245608}
.auth-card h1{margin-bottom:9px;font-size:27px}
.auth-card .eyebrow{font-size:10px;letter-spacing:.17em}
.auth-card form{margin-top:25px}
.auth-card label{font-size:12px}
.auth-card input{margin-top:7px;font-size:14px}
.auth-card .primary{width:100%;margin-top:5px}
.auth-card #setup-hint{margin:20px 0 0;padding-top:18px;border-top:1px solid #eee6f4;font-size:12px}
.setup-card{max-width:570px;margin-top:20px}
.setup-card fieldset+fieldset{margin-top:22px;padding-top:17px;border-top:1px solid #e9e0f1}
.setup-card legend{font-size:15px}
.setup-card #done{margin:20px 0 0}

.list-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:15px}
.list-toolbar p{min-width:0;margin:0}
.list-toolbar button{font-size:12px}
.request-list{display:grid;gap:11px;min-width:0}
.request-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:15px;width:100%;padding:19px 21px;border:1px solid #e3d9ed;border-radius:13px;background:#fff;text-align:left;overflow-wrap:anywhere}
.request-card>span{min-width:0}
.request-card strong{display:block;margin-bottom:5px;color:#5e4770;font-size:15px;line-height:1.6}
.request-card small{display:block;color:#877093;font-size:11px;font-weight:400;line-height:1.6}
.status-tag{display:inline-flex;align-items:center;justify-content:center;max-width:100%;padding:5px 10px;border-radius:7px;background:#f0e7fc;color:#8051ae;font-size:11px;font-weight:650;line-height:1.6;text-align:center;overflow-wrap:anywhere}
.status-tag.applied{background:#e8f6ee;color:#448267}
.status-tag.rejected{background:#f5eeee;color:#977373}
.empty-state{margin:0;padding:50px 23px;border:1px dashed #d9cce8;border-radius:14px;background:#fff;color:#8c729e;text-align:center;font-size:13px}
.request-detail{min-width:0;margin-top:20px;padding:25px;border:1px solid #e2d8ec;border-radius:var(--radius);background:#fff;overflow-wrap:anywhere}
.request-detail h2{color:#644876}
.detail-actions{display:flex;flex-wrap:wrap;gap:8px;min-width:0;margin:18px 0}
.detail-actions button{font-size:12px}
.change-list{min-width:0;margin:0;padding:0;list-style:none}
.change-list li{min-width:0;padding:15px 0;border-top:1px solid #eee7f5}
.change-label{margin-bottom:5px;color:#846396;font-size:11px;font-weight:700;line-height:1.65}
.change-before{color:#9d87aa;font-size:12px;line-height:1.7;text-decoration:line-through}
.change-after{color:#72587f;font-size:13px;line-height:1.7;white-space:pre-wrap}
.notice{min-width:0;margin:0 0 17px;padding:12px 16px;border:1px solid #dfcff4;border-radius:11px;background:#f3ecfc;color:#79589a;font-size:12px;line-height:1.8;overflow-wrap:anywhere}
.notice p{margin-bottom:10px}
.notice.error{border-color:#efcbd2;background:#fff2f4;color:#a04755}
.notice.success{border-color:#c8e4d3;background:#effaf4;color:#4b805e}
.notice button{max-width:100%;font-size:12px}
.skip{position:fixed;z-index:100;top:-120px;left:15px;max-width:calc(100% - 30px);padding:11px 17px;border-radius:9px;background:#fff;color:var(--accent);font-weight:700;box-shadow:0 3px 12px #3320441a}
.skip:focus{top:10px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
[hidden]{display:none!important}

@media(max-width:1150px){
  .topbar{padding:13px 22px}
  #main{padding:21px 22px 24px}
  .editor-grid{grid-template-columns:304px minmax(0,1fr);gap:16px}
  .controls{padding:17px}
  .workflow-chips{font-size:10px}
  .editor-toolbar{gap:9px 12px;padding:12px}
  .page-picker{flex-basis:280px}
  .page-picker select{max-width:310px;flex-basis:190px}
  .toolbar-actions button{padding:8px 11px}
}

@media(max-width:780px){
  .topbar{align-items:center;gap:10px 16px;padding:12px 15px}
  .brand{font-size:18px}
  .brand-mark{min-width:35px;min-height:35px;padding:4px 10px;font-size:21px}
  .brand-copy strong{font-size:16px}
  .brand-copy small{font-size:9px}
  .brand>span:not(.brand-mark):not(.brand-copy){font-size:11px}
  .top-actions{justify-content:flex-start;gap:6px 11px;font-size:10px}
  .top-actions button{min-height:44px;padding:6px 10px;font-size:11px}
  #account-label{font-size:10px}
  #main{padding:18px 14px 24px}
  .workspace-head{gap:12px;margin-bottom:16px}
  .workspace-heading{flex-basis:100%}
  .workspace-head h1{font-size:24px}
  .workspace-head .muted{font-size:11px}
  .workflow-chips{gap:5px;font-size:10px}
  .workflow-chips span{padding:5px 8px}
  .view-tabs{width:100%}
  .view-tabs button{font-size:12px}
  .editor-toolbar{position:sticky;z-index:10;top:0;gap:9px;margin-bottom:14px;padding:12px;border-radius:13px;box-shadow:0 4px 10px #35204707}
  .page-picker{flex:1 1 100%;width:100%;gap:7px;font-size:11px}
  .page-picker select{flex:1 1 195px;max-width:100%;min-height:40px;font-size:12px}
  .page-count{font-size:10px}
  #save-state,.save-state{flex:1 1 100%;order:2;margin:0;font-size:11px}
  .toolbar-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1 1 100%;order:3;gap:7px;width:100%;margin:0}
  .toolbar-actions button{width:100%;min-height:44px;padding:8px 10px;font-size:12px}
  #back-to-requests{grid-column:1/-1}
  .editor-grid{grid-template-columns:minmax(0,1fr);gap:15px}
  .controls{max-height:none;padding:18px;border-radius:13px;overflow:visible;scrollbar-gutter:auto}
  .controls-head h2{font-size:15px}
  .controls-head small{font-size:10px}
  .section-order button{min-height:44px}
  .field-summary{min-height:49px;padding:11px 12px}
  .field-summary-text{font-size:12px}
  .field-body{padding-inline:13px}
  .field-body input,.field-body textarea{font-size:13px}
  .preview-panel{width:100%;border-radius:13px}
  .preview-head{gap:8px;padding:12px 14px}
  .preview-head>div:first-child{flex-basis:140px}
  .preview-width button{min-height:44px}
  .preview-hint{padding:9px 13px;font-size:11px}
  .preview-wrap.mobile{max-width:100%;border:0}
  iframe{height:700px;min-height:440px}
  .auth-card{margin:27px auto;padding:27px 23px;border-radius:16px}
  .auth-card h1{font-size:25px}
  .setup-card{margin-top:9px}
  .request-card{grid-template-columns:minmax(0,1fr);justify-items:start;gap:10px;padding:17px}
  .request-card strong{font-size:14px}
  .request-detail{padding:20px}
  .detail-actions button{flex:1 1 130px;font-size:11px}
  .list-toolbar{align-items:flex-start}
  .list-toolbar p{flex:1 1 180px;font-size:11px}
  .list-toolbar button{font-size:11px}
  .notice{padding:11px 14px;font-size:11px}
}

@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Editing is a viewport canvas. Login and request views keep their document layout. */
body.editor-active{display:flex;flex-direction:column;width:100%;height:100vh;height:100dvh;min-height:0;overflow:hidden;background:#eae6ef}
body.editor-active .topbar{flex:0 0 auto;min-height:52px;gap:7px 16px;padding:7px 16px}
body.editor-active .brand{gap:8px}
body.editor-active .brand-mark{min-width:30px;min-height:30px;padding:3px 9px;border-radius:9px;font-size:18px}
body.editor-active .brand-copy strong{font-size:15px}
body.editor-active .brand-copy small{display:none}
body.editor-active .top-actions{gap:7px 12px;font-size:11px}
body.editor-active .top-actions button{min-height:36px;padding:5px 10px}
body.editor-active .topbar .view-tabs{width:auto;max-width:100%;margin:0;padding:2px}
body.editor-active .topbar .view-tabs button{min-height:32px;padding:4px 9px;font-size:11px}
body.editor-active #main{position:relative;display:flex;flex-direction:column;flex:1 1 auto;width:100%;max-width:none;min-width:0;min-height:0;margin:0;padding:0;overflow:hidden}
body.editor-active #main>#notice{position:absolute;z-index:90;top:10px;left:50%;width:max-content;max-width:calc(100% - 24px);max-height:35dvh;margin:0;overflow:auto;transform:translateX(-50%);box-shadow:0 5px 24px #2b153d26}
body.editor-active #workspace{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:hidden}
body.editor-active .workspace-head{display:none}
body.editor-active #editor-view{position:relative;display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:hidden}
body.editor-active #stale-draft{flex:0 0 auto;max-height:30dvh;margin:0;padding:8px 12px;border-width:0 0 1px;border-radius:0;overflow:auto;font-size:11px}
body.editor-active #stale-draft p{margin-bottom:6px}
body.editor-active .editor-toolbar{position:relative;z-index:8;display:flex;align-items:center;flex-wrap:wrap;flex:0 0 auto;gap:7px 10px;min-height:49px;margin:0;padding:7px 12px;border:0;border-bottom:1px solid #ddd5e8;border-radius:0;background:#fff;box-shadow:none}
body.editor-active .page-picker{flex:1 1 240px;flex-wrap:nowrap;gap:8px;width:auto;max-width:480px;margin:0;font-size:11px}
body.editor-active .page-picker select{flex:1 1 auto;width:100%;max-width:none;min-width:0;min-height:36px;margin:0;padding:6px 28px 6px 10px;font-size:12px}
body.editor-active .page-count{padding:4px 7px;font-size:10px}
body.editor-active #save-state{order:initial;flex:0 1 auto;min-width:0;max-width:250px;margin:0;font-size:11px}
body.editor-active .toolbar-actions{display:flex;flex:0 1 auto;order:initial;gap:7px;width:auto;margin-left:auto}
body.editor-active .toolbar-actions button{width:auto;min-height:36px;padding:6px 12px;font-size:12px}
body.editor-active .toolbar-actions #open-controls{border-color:#d9c5ef;background:#f6f0ff;color:#7543b6}
body.editor-active .editor-grid{position:relative;display:flex;align-items:stretch;flex:1 1 auto;gap:0;min-width:0;min-height:0;overflow:hidden}
body.editor-active .preview-panel{position:relative;display:flex;flex-direction:column;flex:1 1 auto;width:100%;min-width:0;min-height:0;margin:0;border:0;border-radius:0;background:#eae6ef;overflow:hidden;box-shadow:none}
body.editor-active .preview-head{position:relative;z-index:5;top:auto;right:auto;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;flex:0 0 auto;gap:5px 9px;width:100%;max-width:none;min-height:48px;padding:5px 12px;border:0;border-bottom:1px solid #ded4e9;border-radius:0;background:#fff;box-shadow:none}
body.editor-active .preview-head .preview-meta{display:none}
body.editor-active .preview-tools{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:5px;min-width:0;max-width:100%}
body.editor-active .preview-tools>button{flex:0 1 auto;min-width:0;min-height:36px;padding:5px 10px;font-size:13px}
body.editor-active .preview-tools>label{display:inline-flex;align-items:center;gap:4px;min-width:0;margin:0;color:#897294;font-size:12px}
body.editor-active .preview-width{gap:2px;padding:2px;border:0;background:#f5effb}
body.editor-active .preview-width button{min-height:36px;padding:5px 10px;font-size:13px}
body.editor-active .preview-hint{position:absolute;z-index:4;right:auto;bottom:10px;left:10px;width:max-content;max-width:calc(100% - 20px);margin:0;padding:5px 9px;border:1px solid #e3d8ef;border-radius:8px;background:#fffffff0;color:#80668e;font-size:10px;line-height:1.5;box-shadow:0 2px 9px #29163a0d;pointer-events:none}
body.editor-active #preview-viewport{position:relative;display:block;flex:1 1 auto;width:100%;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;background:#eae6ef;scrollbar-width:thin}
body.editor-active #preview-wrap{position:relative;height:100%;max-width:none;min-width:0;min-height:0;margin:0 auto;border:0;background:#fff;transition:none}
body.editor-active #preview-wrap.mobile{max-width:none;border:0}
body.editor-active #preview{display:block;width:100%;height:100%;min-width:0;min-height:0;max-width:none;margin:0;border:0;background:#fff;transform-origin:top left}
body.editor-active .controls{position:absolute;z-index:30;top:10px;right:10px;bottom:10px;display:block;flex:none;width:400px;max-width:calc(100% - 20px);max-height:none;min-height:0;margin:0;padding:0;border:1px solid #d9c9ea;border-radius:15px;background:#fff;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;box-shadow:0 12px 45px #29133e32}
body.editor-active .controls-head{position:sticky;z-index:3;top:0;display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:12px;min-height:62px;margin:0 0 16px;padding:12px 16px;border-bottom:1px solid #e8dff0;background:#fff}
body.editor-active .controls-head>div{min-width:0}
body.editor-active .controls-head h2{font-size:15px}
body.editor-active .controls-head small{display:block;font-size:10px;line-height:1.5}
body.editor-active #close-controls{flex:none;min-width:44px;min-height:44px;padding:7px 10px;font-size:12px}
body.editor-active .controls>:not(.controls-head):not(.inspector-footer){margin-right:17px;margin-left:17px}
body.editor-active .controls #request-note-label{margin-bottom:18px}
body.editor-active .inspector-footer{position:sticky;z-index:3;bottom:0;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;min-height:65px;margin:15px 0 0;padding:11px 16px;border-top:1px solid #e8dff0;background:#fffffffa}
body.editor-active .inspector-footer button{min-height:44px}
body.editor-active .inspector-footer small{flex:1 1 160px;min-width:0;color:#877093;font-size:11px;line-height:1.6}
body.editor-active .zoom-controls,body.editor-active .preview-zoom{display:inline-flex;align-items:center;flex-wrap:wrap;gap:5px;min-width:0;max-width:100%}
body.editor-active .zoom-controls select,body.editor-active .preview-zoom select,body.editor-active #zoom-select,body.editor-active #preview-zoom{width:auto;min-width:0;max-width:110px;min-height:36px;margin:0;padding:5px 7px;font-size:13px}
body.editor-active .inspector-backdrop{position:absolute;z-index:20;inset:0;margin:0;border:0;border-radius:0;background:#21102e33}
body.editor-active:has(#editor-view.canvas-expanded) .topbar{display:none}
body.editor-active #editor-view.canvas-expanded .editor-toolbar{display:none}
body.editor-active #editor-view.canvas-expanded .preview-head{display:flex}

@media(min-width:781px){body.editor-active #inspector-backdrop{background:transparent;pointer-events:none}}

@media(max-width:780px){
  body.editor-active .topbar{gap:6px 10px;min-height:49px;padding:5px 10px;padding-top:max(5px,env(safe-area-inset-top,0px));padding-right:max(10px,env(safe-area-inset-right,0px));padding-left:max(10px,env(safe-area-inset-left,0px))}
  body.editor-active .brand{gap:7px}
  body.editor-active .brand-mark{min-width:29px;min-height:29px;padding:3px 8px;font-size:18px}
  body.editor-active .brand-copy strong{font-size:14px}
  body.editor-active .top-actions{gap:5px 8px;max-width:100%;margin-left:auto;font-size:10px}
  body.editor-active .top-actions button{min-height:44px;padding:5px 8px;font-size:11px}
  body.editor-active .topbar .view-tabs button{min-height:44px;padding:5px 8px;font-size:11px}
  body.editor-active #account-label{display:none}
  body.editor-active .editor-toolbar{gap:5px 8px;min-height:48px;padding:5px 9px}
  body.editor-active .page-picker{flex:1 1 180px;max-width:none;gap:0;font-size:0}
  body.editor-active .page-picker select{min-height:44px;padding:6px 27px 6px 9px;font-size:16px}
  body.editor-active .page-count{display:none}
  body.editor-active #save-state{flex:0 1 auto;max-width:110px;font-size:10px}
  body.editor-active .toolbar-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex:1 1 100%;gap:6px;width:100%;margin:0}
  body.editor-active .toolbar-actions button{width:100%;min-height:44px;padding:7px 7px;font-size:12px}
  body.editor-active .toolbar-actions #back-to-requests{grid-column:1/-1}
  body.editor-active .preview-head{top:auto;right:auto;gap:4px 6px;max-width:none;min-height:52px;padding:3px 9px;border-radius:0}
  body.editor-active .preview-width button{min-height:44px;padding:5px 8px;font-size:12px}
  body.editor-active .preview-tools{gap:4px}
  body.editor-active .preview-tools>button{min-height:44px;padding:5px 7px;font-size:12px}
  body.editor-active .preview-tools .zoom-label{display:none}
  body.editor-active[data-preview-device="desktop"] .preview-tools>.zoom-label{display:inline-flex}
  body.editor-active .zoom-controls select,body.editor-active .preview-zoom select,body.editor-active #zoom-select,body.editor-active #preview-zoom{min-height:44px;font-size:16px}
  body.editor-active .preview-hint{right:7px;bottom:7px;left:7px;max-width:calc(100% - 14px);font-size:10px}
  body.editor-active .controls{position:fixed;z-index:60;inset:0;width:100%;max-width:none;height:100vh;height:100dvh;max-height:none;padding:0;border:0;border-radius:0;scrollbar-gutter:auto;box-shadow:none}
  body.editor-active .controls-head{min-height:64px;margin-bottom:17px;padding:calc(10px + env(safe-area-inset-top,0px)) 16px 10px}
  body.editor-active .controls-head h2{font-size:18px}
  body.editor-active .controls-head small{font-size:12px}
  body.editor-active #close-controls{min-width:48px;min-height:44px;font-size:14px}
  body.editor-active .controls input,body.editor-active .controls textarea,body.editor-active .controls select{font-size:16px}
  body.editor-active .controls input[type=file]{font-size:14px}
  body.editor-active .controls label{font-size:13px}
  body.editor-active .controls .field-body label{font-size:12px}
  body.editor-active .controls .field-summary-text{font-size:13px}
  body.editor-active .controls .field-summary{min-height:54px}
  body.editor-active .inspector-footer{min-height:70px;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px))}
  body.editor-active .inspector-footer button{flex:1 1 120px;font-size:15px}
}

@media(hover:hover) and (pointer:fine){
  button:hover,.button:hover{border-color:#c8b4e6;background:#f5f0fd}
  .primary:hover{border-color:#5923bd;background:#5923bd}
  .top-actions a:hover{color:var(--accent);text-decoration:underline}
}
