/* 조각 배치 화면 — pdm.css의 색·버튼·카드 위에 배치 화면 전용 배치만 더한다. */
body.collage { --side-w: 316px; }
.brand-text h1 small { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }

body.collage .mode-link { margin-left: auto; }
.primary-outline:not(:disabled) { border-color: var(--primary-line); color: var(--primary); }
.primary-outline:not(:disabled):hover { background: var(--primary-soft); border-color: var(--primary); }
body.collage #exportDxfBtn:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(106, 76, 255, .28); }
body.collage #exportDxfBtn:not(:disabled):hover { background: var(--primary-hover); }

.collage-main { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); min-height: 0; min-width: 0; }
body.collage #viewport { cursor: default; }
body.collage #viewport.panning, body.collage #viewport.space { cursor: grab; }
body.collage #viewport.panning { cursor: grabbing; }
body.collage #viewport.over-item { cursor: move; }
body.collage #viewport.over-handle { cursor: alias; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
body.collage #emptyState { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; }
body.collage .empty-card { pointer-events: auto; max-width: 470px; }
.empty-steps { margin: 4px 0 6px; padding-left: 20px; text-align: left; font-size: 12.5px; color: var(--text-2); }
.empty-steps li { margin: 3px 0; }
.empty-buttons { display: flex; gap: 8px; }
.empty-open.secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--primary-line); }
.empty-open.secondary:hover { background: var(--primary-soft); }

.cursor-pos { flex: none; min-width: 150px; color: var(--muted); font: 600 12px/1 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }

.row-2 { display: flex; gap: 8px; align-items: stretch; }
.row-2 .wide-button { flex: 1; min-height: 38px; }
.unit-select { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.unit-select select, .field-grid select { height: 34px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 12.5px; color: var(--text); }
#addPatchBtn { margin-bottom: 2px; }
#addPatternBtn, #addPatchBtn { border-color: var(--primary-line); background: var(--primary-soft); color: var(--primary); }
#addPatternBtn:hover, #addPatchBtn:hover { background: #e7e0ff; border-color: var(--primary); }

.item-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.item-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.item-list li:hover { border-color: var(--line-strong); }
.item-list li.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.item-list li.empty-row { display: block; text-align: center; padding: 12px; border-style: dashed; background: transparent; color: var(--muted); font-size: 12px; cursor: default; }
.item-list .thumb { width: 34px; height: 34px; border-radius: 6px; background: #fff center/contain no-repeat; border: 1px solid var(--line); }
.item-list .list-icon { width: 20px; height: 20px; color: var(--text-2); }
.item-list .meta { min-width: 0; display: flex; flex-direction: column; }
.item-list strong, .item-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-list strong { font-size: 12.5px; font-weight: 700; }
.item-list small { color: var(--muted); font: 600 11px/1.4 var(--mono); }
.item-list .tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.item-list .tag.on { background: var(--ok-soft); color: #08714e; }
.item-list .tag.warn { background: var(--warn-soft); color: #8a5800; }

.sel-info { margin: 0 0 8px; color: var(--muted); font: 600 11.5px/1.5 var(--mono); }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.button-grid button { min-height: 32px; padding: 0 8px; font-size: 12px; }
.button-grid button kbd { height: 15px; min-width: 15px; padding: 0 3px; font-size: 9.5px; }
.button-grid .danger:not(:disabled) { color: #c42b2b; border-color: #f3c2c2; grid-column: span 2; }
.button-grid .danger:not(:disabled):hover { background: var(--err-soft); }
.check-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
body.collage .field-grid { grid-template-columns: 74px 1fr; }
body.collage .field-grid input[type="text"] { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 13px; }

@media (max-width: 1080px) { .header-actions .btn-text, .history-actions .btn-text { display: none; } }
@media (max-width: 900px) {
  .collage-main { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 60vh) auto; overflow-y: auto; }
  body.collage { overflow: auto; }
  body.collage .side-panel { border-left: 0; border-top: 1px solid var(--line); }
}
.clo-button { margin-top: 10px; }
.clo-button:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.clo-button:not(:disabled):hover { background: #e7e0ff; }
