/* 부품 modal — 모달. 묶음: templates/ui/modal.html · static/ui/parts/modal/modal.css · modal.md.
   바탕(static/ui/base/ui.css)의 변수 · 단추 클래스에 기댄다. CDN·의존 없음. */
.nx-modal { width: min(520px, calc(100vw - 2 * var(--sp-3))); max-height: calc(100vh - 2 * var(--sp-5)); padding: 0;
            border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.nx-modal[data-size="sm"] { width: min(380px, calc(100vw - 2 * var(--sp-3))); }
.nx-modal[data-size="lg"] { width: min(820px, calc(100vw - 2 * var(--sp-3))); }
.nx-modal[data-size="xl"] { width: min(1120px, calc(100vw - 2 * var(--sp-3))); }   /* 칸이 많은 단계 폼(➕ 크롤러 추가) */
.nx-modal::backdrop { background: var(--backdrop); }
.nx-modal-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.nx-modal-head h2 { flex: 1; margin: 0; font-size: var(--fs-m); }
.nx-modal-body { padding: var(--sp-4); overflow-y: auto; max-height: calc(100vh - 160px); }
.nx-modal-body > .nx-actions:last-child { margin-bottom: 0; }
/* 발 — 몸통이 길어 굴려도 오른쪽 아래에 늘 보이는 단추 줄(미리보기 표 밑) */
.nx-modal-foot { position: sticky; bottom: calc(-1 * var(--sp-4)); z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2);
                 margin: var(--sp-3) calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); background: var(--surface); }
.nx-modal-foot > span:first-child { margin-right: auto; }
@media (max-width: 600px) { .nx-modal-foot > span:first-child:not(:empty) { flex-basis: 100%; } }
/* 모달이 열린 동안 뒤 화면은 굴러가지 않는다 — 몸통 끝에 닿아도 뒤로 넘기지 않는다(2026-12-02 사람 요청) */
html:has(dialog.nx-modal[open]) { overflow: hidden; scrollbar-gutter: stable; }
.nx-modal-body { overscroll-behavior: contain; }
