/* 빌더 모듈 결과물 패널 (canvas 'code') */
.bd { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.bd .spin { animation: spin 1s linear infinite; }
.bd-head { gap: 6px; }
.bd-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.bd-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.bd-tabs button svg.lucide { width: 15px; height: 15px; }
.bd-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.bd-count:not(:empty) { font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); display: inline-flex; align-items: center; justify-content: center; }
.bd-devices { display: inline-flex; gap: 2px; }
.bd-devices svg.lucide { width: 16px; height: 16px; }
.bd-head .btn.is-published { background: var(--ok); border-color: var(--ok); }
.bd-head .btn.is-published:hover { filter: brightness(.95); }

.bd-build { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 13px; color: var(--brand-700); background: var(--brand-50); border-bottom: 1px solid var(--brand-100); }
.bd-build svg.lucide { width: 15px; height: 15px; flex: none; }

.bd-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bd-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* 미리 보기 */
.bd-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 13px; border-bottom: 1px solid var(--border); background: var(--surface); }
.bd-bar svg.lucide { width: 16px; height: 16px; flex: none; }
.bd-vbar { background: var(--brand-50); color: var(--brand-700); }
.bd-errors { background: #FFF5F4; color: var(--danger); }
.bd-errors .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-pages { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.bd-pages svg.lucide { width: 15px; height: 15px; }
.bd-pages select { height: 30px; width: auto; min-width: 160px; font-size: 13px; padding: 0 8px; }
.bd-stage { flex: 1; min-height: 0; position: relative; overflow: auto; display: flex; }
.bd-stage.is-framed { padding: 12px; background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 18px 18px; }
.bd-box { position: relative; flex: none; margin: auto; }
.bd-stage:not(.is-framed) .bd-box { flex: 1; margin: 0; }
.bd-frame { display: block; border: 0; background: #fff; }
.bd-stage.is-framed .bd-box { box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); border-radius: 6px; overflow: hidden; background: #fff; }
.bd-empty { margin: auto; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bd-empty svg.lucide { width: 44px; height: 44px; color: var(--border-2); }

/* 코드 */
.bd-files { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface); overflow-x: auto; flex: none; }
.bd-file { display: inline-flex; align-items: center; border-radius: 8px; border: 1px solid transparent; white-space: nowrap; }
.bd-file > button[data-file] { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; height: 28px; padding: 0 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); cursor: pointer; }
.bd-file > button svg.lucide { width: 13px; height: 13px; }
.bd-file.is-on { background: var(--surface-2); border-color: var(--border); }
.bd-file.is-on > button[data-file] { color: var(--text); font-weight: 600; }
.bd-file.is-dirty > button[data-file]::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.bd-file-x { border: 0; background: none; width: 22px; height: 22px; margin-right: 3px; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.bd-file-x:hover { background: var(--border); color: var(--danger); }
.bd-file-x svg.lucide { width: 13px; height: 13px; }
.bd-editor-wrap { flex: 1; min-height: 0; display: flex; position: relative; }
.bd-editor, .bd-stream { flex: 1; min-height: 0; margin: 0; border: 0; border-radius: 0; resize: none; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.6; tab-size: 2; white-space: pre; overflow: auto; background: #1D1B1A; color: #ECE6DF; outline: none; box-shadow: none; height: auto; width: 100%; }
.bd-editor:focus { box-shadow: none; border: 0; }
.bd-editor::selection { background: rgba(211, 100, 63, .45); }
.bd-stream { white-space: pre-wrap; word-break: break-all; color: #CFE8D5; }
.bd-code-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--surface); font-size: 12.5px; flex: none; }

/* 버전 */
.bd-versions { overflow: auto; padding: 16px; }
.bd-ver-help { font-size: 13px; margin: 0 0 10px; }
.bd-ver { gap: 10px; }
.bd-ver-main { display: flex; flex-direction: column; min-width: 0; }
.bd-ver-main b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-ver-main small { font-size: 12px; }
.bd-ver.is-now { background: var(--brand-50); }

/* 게시 창 */
.bd-slug { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: 11px; background: var(--surface-2); overflow: hidden; }
.bd-slug input { border: 0; border-radius: 0; height: 40px; flex: 1; min-width: 80px; padding: 0 6px; background: var(--surface); }
.bd-slug input:focus { box-shadow: none; }
.bd-slug-base { padding: 0 8px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.bd-pub-url { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); margin-bottom: 6px; }
.bd-pub-url a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); font-weight: 600; }
.bd-pub-meta { font-size: 13px; margin: 0 0 14px; }
.bd-pub-note { font-size: 12.5px; margin: 4px 0 0; }
.bd-slug-field .btn.sm { align-self: flex-start; }

@media (max-width: 860px) {
  .bd-tabs button span { display: none; }
  .bd-head .btn span { display: none; }
  .bd-devices { display: none; }
}
