/* Keep the same live SVG visible while editing; no duplicate preview state. */
#pops-site #pops-design{overflow:visible;min-width:0}
#pops-site #pops-design .ps-design-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:24px;align-items:start;overflow:visible}
#pops-site #pops-design .ps-design-layout>[data-design-fields]{min-width:0}
#pops-site #pops-design .ps-design-layout>div:last-child{position:sticky;top:12px;align-self:start;min-width:0;padding:10px;background:#fff;border:1px solid #d6e2e8;border-radius:10px;box-sizing:border-box;z-index:5}
#pops-site #pops-design [data-pops-design-preview]{width:100%;height:clamp(220px,55vh,600px);max-height:min(62vh,620px);max-width:100%;padding:0;margin:0;overflow:hidden;box-sizing:border-box;cursor:zoom-in;background:#fff;border:0}
#pops-site #pops-design [data-pops-design-preview]>svg{display:block;width:100%;height:100%;max-width:100%;max-height:100%;margin:0}
#pops-site #pops-design .ps-design-layout>div:last-child>p{margin:6px 0 0;font-size:12px;line-height:1.4}
@media(max-width:760px){
 /* 2026-11-28 남일 님: 미리보기 상자가 위에 붙어 따라다니며 「상호·행사 제목」 입력칸과 「추가 문구」를 덮던 문제 수정.
    좁은 화면에서는 미리보기를 붙박이(sticky)로 띄우지 않고 제자리에 두어 아래 입력칸을 절대 가리지 않게 합니다. */
 #pops-site #pops-design .ps-design-layout{display:flex;flex-direction:column;gap:14px;align-items:stretch}
 #pops-site #pops-design .ps-design-layout>div:last-child{order:-1;position:static;top:auto;align-self:stretch;width:100%;padding:6px;z-index:auto;box-shadow:none}
 #pops-site #pops-design [data-pops-design-preview]{height:auto;max-height:min(46vh,420px)}
 #pops-site #pops-design .ps-design-layout>div:last-child>p{display:none}
 #pops-site #pops-design [data-design-fields]{width:100%;min-width:0}
}
@media(max-width:760px) and (max-height:500px){
 #pops-site #pops-design [data-pops-design-preview]{height:100px}
 #pops-site #pops-design [data-design-fields] input,#pops-site #pops-design [data-design-fields] select{scroll-margin-top:125px}
}

#pops-site .pops-live-layout{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)!important;gap:24px;align-items:start;overflow:visible}
#pops-site .pops-live-layout>div:first-child{min-width:0}
#pops-site .pops-live-layout .ps-cover-preview{position:static!important;max-width:100%;width:100%;margin:20px 0 0;padding:0}
#pops-site .pops-live-layout .ps-cover-workspace{display:block!important;max-width:none;max-height:none;overflow:visible}
#pops-site .pops-live-layout [data-cover-tools]{max-height:none!important;overflow:visible!important}
#pops-site .pops-live-stage{position:sticky;top:12px;align-self:start;min-width:0;width:100%;box-sizing:border-box;padding:8px;border:1px solid #d6e2e8;border-radius:10px;background:#fff;z-index:5}
#pops-site .pops-live-stage .ps-cover-canvas{display:block!important;width:100%;max-width:none;height:clamp(240px,65vh,720px);padding:0!important;margin:0!important;overflow:hidden}
#pops-site .pops-live-stage [data-cover-sheet]{display:flex;align-items:center;justify-content:center;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;padding:0!important;margin:0!important;overflow:hidden}
#pops-site .pops-live-stage [data-cover-sheet]>svg{display:block;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;margin:0!important}
#pops-site .pops-live-stage .ps-cover-zoom-hint{display:none}
@media(max-width:760px){
 #pops-site .pops-live-layout{display:flex!important;flex-direction:column!important;align-items:stretch;gap:14px}
 #pops-site .pops-live-layout>div:first-child{width:100%}
 #pops-site .pops-live-stage{order:-1;top:6px;z-index:20;padding:6px;box-shadow:0 3px 12px #18354a18}
 #pops-site .pops-live-stage .ps-cover-canvas{height:clamp(110px,24vh,200px);height:clamp(110px,24dvh,200px)}
 #pops-site .pops-live-layout input,#pops-site .pops-live-layout textarea,#pops-site .pops-live-layout select{scroll-margin-top:240px}
}
@media(max-width:760px) and (max-height:500px){#pops-site .pops-live-stage .ps-cover-canvas{height:100px}#pops-site .pops-live-layout input,#pops-site .pops-live-layout textarea{scroll-margin-top:125px}}

/* 2026-11-28 전단지(필드셋) 미리보기 중복·잘림 수정
   - 모바일 규칙(max-height:min(46vh,420px))이 A4 세로 전단지(1000:1414) 아래쪽을 잘라 '반쯤 잘린 미리보기'가 됐고,
     같은 디자인이 패널 썸네일로 한 번 더 크게 나와 이미지가 2개로 보였습니다.
   - 필드셋 모드([data-fs-view])에서는 높이를 제한하지 않고 종이 전체를 그대로 보여 줍니다. 썸네일 중복은 fields.js에서 제거. */
#pops-site #pops-design [data-pops-design-preview][data-fs-view]{height:auto!important;max-height:none!important;overflow:visible!important;aspect-ratio:auto!important;cursor:default}
#pops-site #pops-design [data-pops-design-preview][data-fs-view]>svg{width:100%!important;height:auto!important;max-height:none!important;display:block}
@media(max-width:760px){
 #pops-site #pops-design [data-pops-design-preview][data-fs-view]{max-height:none!important}
}

/* 2026-11-28 전단지(필드셋) PC 배치: 입력칸([data-design-fields])이 숨겨지는 필드셋 모드에서는 2단 그리드의
   한 칸이 비어 미리보기가 왼쪽에만 붙어 보였습니다. 미리보기(왼쪽) + 문구 입력 패널(오른쪽) 2단으로 채웁니다. */
@media(min-width:761px){
 #pops-site #pops-design.fs-mode .ps-design-layout{grid-template-columns:minmax(0,1fr)}
 #pops-site #pops-design.fs-mode .ps-design-layout>div:last-child{position:static;top:auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:22px;align-items:start}
 #pops-site #pops-design.fs-mode [data-pops-design-preview]{grid-column:1;grid-row:1}
 #pops-site #pops-design.fs-mode .pops-fs-panel{grid-column:2;grid-row:1/span 2;margin-top:0!important}
 #pops-site #pops-design.fs-mode .ps-design-layout>div:last-child>p{grid-column:1;grid-row:2}
}
