/* HWP JPG 변환기 전용 CSS (2026-10-20). '문서 라이트 테이블': 위 띠(문서 | 해상도) → 책상(종이 미리 보기 | 쪽 목록 + 저장) → 상태 한 줄.
   두 열/한 열은 툴 폭 컨테이너 쿼리(@container hj)로 나눈다. 옆 칸 쪽 목록은 미리 보기 높이에 맞춰 스크롤한다(목록이 줄 높이를 키우지 않음). 공용 부품은 assets/v2.css. */
.hj-work{container:hj / inline-size;position:relative;--hj-cap:min(68vh,700px)}
.hj-work.is-over{outline:2px dashed var(--ink);outline-offset:-6px}
.hj-work [hidden]{display:none!important}

/* 위 띠 */
.hj-bar{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px 20px;padding:12px 16px;border-bottom:1px solid var(--soft)}
.hj-doc{display:flex;align-items:center;gap:10px;min-width:0}
.hj-docico{flex:0 0 auto;width:30px;height:30px;color:var(--muted)}
.hj-docname{display:flex;flex-direction:column;gap:2px;min-width:0;margin:0}
.hj-docname b{font-family:var(--sans);font-size:14px;font-weight:700;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hj-docname span{font-family:var(--sans);font-size:12px;color:var(--muted)}
.hj-dpi{display:grid;grid-template-columns:auto auto;align-items:center;justify-items:end;gap:4px 8px}
.hj-dpi .v2-seg button b{font-weight:inherit}
.hj-dpi .v2-seg button small{font-size:inherit;font-weight:500}
.hj-dpi .v2-seg button small::before{content:" · "}
.hj-hint{grid-column:1 / -1;font-family:var(--mono);font-size:11.5px;color:var(--muted)}
.hj-prog{position:absolute;left:0;right:0;bottom:-1px;height:2px;overflow:hidden;display:none}
.hj-prog.is-on{display:block}
.hj-prog i{display:block;height:100%;background:var(--accent);transform:scaleX(0);transform-origin:0 50%}
.hj-prog.is-on i{transition:transform .25s}

/* 책상: 종이 | 옆 칸 */
.hj-desk{display:grid;grid-template-columns:minmax(0,1fr) 216px}
.hj-stage{min-width:0;padding:16px;display:flex;flex-direction:column}
.hj-side{position:relative;min-width:0;border-left:1px solid var(--soft)}

/* 고르기 전: 끌어 놓기 상자 */
.hj-drop{flex:1;display:flex;flex-direction:column;gap:10px}
.hj-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.hj-dropbox{flex:1;min-height:250px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:22px 16px;border:1px dashed var(--line);border-radius:var(--radius);background:color-mix(in srgb, var(--wash) 55%, var(--paper));text-align:center;cursor:pointer;transition:background var(--ease),border-color var(--ease)}
.hj-dropbox b{max-width:30em;font-family:var(--sans);font-size:15px;font-weight:700;line-height:1.45;color:var(--ink)}
.hj-dropbox > span:not(.hj-sheets):not(.v2-btn){font-family:var(--sans);font-size:12.5px;line-height:1.55;color:var(--muted)}
.hj-dropbox .hj-pickbtn{margin-top:8px;pointer-events:none}
.hj-dropbox:hover,.hj-work.is-over .hj-dropbox{background:var(--wash);border-color:var(--ink)}
.hj-file:focus-visible + .hj-dropbox{outline:2px solid var(--accent);outline-offset:2px}
.hj-sheets{position:relative;width:58px;height:72px;margin-bottom:8px}
.hj-sheets i{position:absolute;inset:0;border:1px solid var(--line);border-radius:2px;background:var(--paper)}
.hj-sheets i:nth-child(1){transform:rotate(-9deg) translate(-7px,2px)}
.hj-sheets i:nth-child(2){transform:rotate(6deg) translate(6px,1px)}
.hj-sheets i:nth-child(3){background:var(--paper) linear-gradient(var(--soft),var(--soft)) 9px 12px / 26px 3px no-repeat;box-shadow:inset 9px 22px 0 -8px var(--paper)}
.hj-sheets i:nth-child(3)::after{content:"";position:absolute;left:9px;right:9px;top:24px;height:30px;background:repeating-linear-gradient(to bottom,var(--soft) 0 2px,transparent 2px 7px)}
.hj-dropbox:hover .hj-sheets i,.hj-work.is-over .hj-sheets i{transition:transform .3s cubic-bezier(.2,.7,.2,1)}
.hj-dropbox:hover .hj-sheets i:nth-child(1),.hj-work.is-over .hj-sheets i:nth-child(1){transform:rotate(-16deg) translate(-14px,3px)}
.hj-dropbox:hover .hj-sheets i:nth-child(2),.hj-work.is-over .hj-sheets i:nth-child(2){transform:rotate(12deg) translate(13px,2px)}
.hj-facts{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 8px;margin:0;padding:0;list-style:none;font-family:var(--sans);font-size:12px;color:var(--muted)}
.hj-facts li{padding:2px 8px;border:1px solid var(--soft);border-radius:var(--radius);background:var(--paper)}

/* 예시 문서 카드(옆 칸) */
.hj-sample{display:flex;flex-direction:column;gap:10px;height:100%;padding:16px}
.hj-sample img{display:block;width:100%;height:auto;aspect-ratio:265 / 374;border:1px solid var(--line);border-radius:2px;background:#fff;box-shadow:0 4px 14px rgba(0,0,0,.08)}
.hj-sample p{display:flex;flex-direction:column;gap:3px;margin:0}
.hj-sample b{font-family:var(--sans);font-size:13.5px;font-weight:700;color:var(--ink)}
.hj-sample span{font-family:var(--sans);font-size:12px;line-height:1.5;color:var(--muted)}
.hj-sample .v2-btn{justify-content:center;margin-top:auto}

/* 암호 */
.hj-pw{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px;min-height:250px;padding:20px;border:1px solid var(--soft);border-radius:var(--radius);background:color-mix(in srgb, var(--wash) 55%, var(--paper))}
.hj-pwtitle{display:flex;flex-direction:column;gap:4px;margin:0;max-width:34em}
.hj-pwtitle b{font-family:var(--sans);font-size:15px;font-weight:700;color:var(--ink)}
.hj-pwtitle span{font-family:var(--sans);font-size:12.5px;line-height:1.55;color:var(--muted)}
.hj-pwrow{display:grid;grid-template-columns:minmax(0,260px) auto;gap:8px;align-items:start}
.hj-pwbtns > div{display:flex;gap:6px}

/* 미리 보기 */
.hj-view{flex:1;display:flex;flex-direction:column;gap:10px}
.hj-paperwrap{display:flex;justify-content:center;align-items:flex-start;padding:16px;border-radius:var(--radius);background:color-mix(in srgb, var(--wash) 80%, var(--paper));overflow:hidden;outline:none}
.hj-paperwrap:focus-visible{box-shadow:0 0 0 2px var(--accent)}
.hj-paper{position:relative;margin:0;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.14),0 8px 22px rgba(0,0,0,.10);line-height:0}
.hj-paper img{display:block;max-width:100%;max-height:var(--hj-cap);width:auto;height:auto}
.hj-paper.is-empty{width:min(100%, calc(var(--hj-cap) * var(--arn, .7071)));aspect-ratio:var(--ar, 210 / 297)}
.hj-paper.is-empty::after{content:"";position:absolute;left:0;right:0;top:0;height:22%;background:linear-gradient(to bottom,transparent,color-mix(in srgb, var(--accent) 16%, transparent));animation:hj-scan 1.2s linear infinite}
.hj-paper.is-dev img{animation:hj-dev .6s cubic-bezier(.2,.7,.2,1)}
@keyframes hj-dev{from{clip-path:inset(0 0 100% 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes hj-scan{from{transform:translateY(-100%)}to{transform:translateY(460%)}}
.hj-paperwrap.is-zoom{justify-content:flex-start;max-height:calc(var(--hj-cap) + 32px);overflow:auto}
.hj-paperwrap.is-zoom .hj-paper img{max-width:none;max-height:none}
.hj-nav{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.hj-arrow{width:32px;padding:0;justify-content:center}
.hj-arrow .i{transform:rotate(180deg)}
.hj-arrow--next .i{transform:none}
.hj-pos{min-width:62px;font-family:var(--mono);font-size:13px;font-weight:600;text-align:center;color:var(--ink)}
.hj-pinfo{margin-right:auto;font-family:var(--mono);font-size:11.5px;color:var(--muted)}
.hj-font{margin:0;font-family:var(--sans);font-size:12px;line-height:1.55;color:var(--muted)}
.hj-font.is-miss{padding-left:10px;border-left:2px solid var(--accent)}

/* 옆 칸: 쪽 목록 + 저장. 두 열일 때는 미리 보기 높이를 따른다 */
.hj-pages{position:absolute;inset:0;display:flex;flex-direction:column}
.hj-pghead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 14px 8px}
.hj-all{padding:2px 0;border:0;background:none;font-family:var(--sans);font-size:12px;font-weight:600;color:var(--muted);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.hj-all:hover{color:var(--ink)}
.hj-list{flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:12px 10px;margin:0;padding:4px 14px 12px;list-style:none}
.hj-list:has(> li:only-child),.hj-list:has(> li:nth-child(2):last-child){grid-template-columns:minmax(0,1fr)}
.hj-pg{display:flex;flex-direction:column;gap:5px;min-width:0}
.hj-th{position:relative;display:block;width:100%;padding:0;border:1px solid var(--line);border-radius:2px;background:#fff;overflow:hidden;cursor:pointer}
.hj-th img{display:block;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .35s}
.hj-pg.is-ready .hj-th img{opacity:1}
.hj-pg.is-busy.is-ready .hj-th img{opacity:.4}
.hj-scan{position:absolute;left:0;right:0;top:0;height:30%;background:linear-gradient(to bottom,transparent,color-mix(in srgb, var(--accent) 20%, transparent));opacity:0;pointer-events:none}
.hj-pg.is-busy .hj-scan{opacity:1;animation:hj-scan 1.1s linear infinite}
.hj-pg.is-bad .hj-th{background:repeating-linear-gradient(135deg,#fff 0 6px,#f1e9e4 6px 8px)}
.hj-pg.is-cur .hj-th{outline:2px solid var(--ink);outline-offset:1px}
.hj-th:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hj-ck{display:flex;align-items:center;gap:6px;font-family:var(--sans);font-size:12.5px;font-weight:600;color:var(--ink);cursor:pointer}
.hj-ck input{width:15px;height:15px;margin:0;accent-color:var(--ink)}
.hj-kb{font-family:var(--mono);font-size:11px;color:var(--muted);min-height:1.3em}
.hj-foot{display:grid;gap:8px;padding:12px 14px 14px;border-top:1px solid var(--soft)}
.hj-sum{margin:0;font-family:var(--sans);font-size:12.5px;line-height:1.45;color:var(--ink)}
.hj-acts{display:flex;flex-wrap:wrap;gap:6px}
.hj-acts .v2-btn{flex:1 1 auto;justify-content:center;white-space:nowrap}
.hj-acts .v2-btn--primary{flex-basis:100%}
.hj-status{margin:0;padding:9px 16px;border-top:1px solid var(--soft);line-height:1.5}
.hj-status:empty{padding:0;border-top:0}

/* 좁은 툴 폭: 한 열. 쪽 목록은 가로로 넘기는 줄 */
@container hj (max-width:640px){
  .hj-bar{grid-template-columns:minmax(0,1fr)}
  .hj-dpi{grid-template-columns:minmax(0,1fr);justify-items:start}
  .hj-desk{grid-template-columns:minmax(0,1fr)}
  .hj-side{border-left:0;border-top:1px solid var(--soft)}
  .hj-pages{position:static}
  .hj-list,.hj-list:has(> li:only-child),.hj-list:has(> li:nth-child(2):last-child){grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:88px;overflow-x:auto;overflow-y:hidden;padding-bottom:10px}
  .hj-acts .v2-btn--primary{flex-basis:auto}
  .hj-sample{flex-direction:row;align-items:center;height:auto;padding:12px 16px}
  .hj-sample img{width:64px;flex:0 0 auto}
  .hj-sample p{flex:1;min-width:0}
  .hj-sample .v2-btn{margin-top:0;flex:0 0 auto}
  .hj-dropbox{min-height:190px}
  .hj-work{--hj-cap:min(62vh,560px)}
}
@container hj (max-width:420px){
  .hj-dpi .v2-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
  .hj-dpi .v2-seg button{display:flex;flex-direction:column;align-items:center;justify-content:center;height:auto;min-height:42px;padding:5px 4px;line-height:1.25}
  .hj-dpi .v2-seg button small{font-size:11px}
  .hj-dpi .v2-seg button small::before{content:none}
  .hj-sample{flex-wrap:wrap}
  .hj-sample .v2-btn{flex:1 1 100%}
  .hj-pwrow{grid-template-columns:minmax(0,1fr)}
  .hj-pwbtns > .v2-label{display:none}
  .hj-paperwrap{padding:10px}
}
@media (prefers-reduced-motion:reduce){
  .hj-paper.is-dev img,.hj-pg.is-busy .hj-scan,.hj-paper.is-empty::after{animation:none}
  .hj-pg.is-busy .hj-scan,.hj-paper.is-empty::after{opacity:0}
  .hj-dropbox:hover .hj-sheets i,.hj-work.is-over .hj-sheets i,.hj-th img,.hj-prog.is-on i{transition:none}
}
