/* ── 스토리보드 패널 (js/board.js) ── */
.sdb { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; background: var(--panel); position: relative; }
.sdb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #151b25; flex: none; min-height: 40px; }
.sdb-head .btn, .sdb-head .tb { white-space: nowrap; }
.sdb-title { font-size: 12.5px; font-weight: 600; color: #c8d3e6; white-space: nowrap; }
.sdb-title small { font-weight: 400; color: var(--faint); margin-left: 3px; }
.sdb-actions { margin-left: auto; display: flex; gap: 4px; }
.sdb-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 8px 40px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: #34405a transparent; }
.sdb-list::-webkit-scrollbar { width: 8px; }
.sdb-list::-webkit-scrollbar-thumb { background: #34405a; border-radius: 4px; }
.sdb-list::-webkit-scrollbar-track { background: transparent; }

/* 빈 상태 */
.sdb-empty { margin: 18px 6px; padding: 18px 12px; border: 1px dashed #2f3a4e; border-radius: 12px; text-align: center; color: var(--dim); font-size: 13px; }
.sdb-empty p { margin: 0 0 10px; }
.sdb-empty .sdb-hint { margin: 12px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.sdb-empty-btns { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* 카드 */
.sdb-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 5px; outline: none; transition: border-color .12s, box-shadow .12s; flex: none; }
.sdb-card:hover { border-color: #3a4760; }
.sdb-card:focus-within, .sdb-card:focus { border-color: #46567a; }
.sdb-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(106,168,255,.18); }
.sdb-card.warn { border-color: rgba(240,185,90,.55); }
.sdb-card.drop { border-color: var(--accent2); box-shadow: 0 0 0 2px var(--accent2); }

.sdb-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 7px; background: #0e1219; overflow: hidden; cursor: zoom-in; color: var(--faint); font-size: 12px; }
.sdb-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sdb-thumb.noimg { cursor: pointer; border: 1px dashed #2f3a4e; background: #141a24; aspect-ratio: 16 / 6; line-height: 1.4; text-align: center; }
.sdb-thumb.noimg:hover { border-color: #5d79b5; color: #b8c3d6; }
.sdb-thumb.noimg small { font-size: 11px; }
.sdb-loading { font-size: 11.5px; color: var(--faint); }

.sdb-meta { display: flex; align-items: center; gap: 5px; min-width: 0; }
.sdb-no { flex: none; min-width: 22px; text-align: center; font: 11px var(--mono); color: var(--faint); background: #151b25; border-radius: 6px; padding: 1px 4px; }
.sdb-card.on .sdb-no { background: #2d5fb8; color: #fff; }
.sdb-scene { flex: 1; min-width: 0; padding: 2px 6px; font-size: 12px; border-radius: 6px; text-overflow: ellipsis; }
.sdb-card.free .sdb-scene { color: var(--dim); }
.sdb-card.on .sdb-scene { border-color: #3b74d8; color: #fff; }
.sdb-card.warn .sdb-scene { border-color: rgba(240,185,90,.6); color: var(--warn); }
.sdb-go { flex: none; width: 24px; height: 24px; padding: 0; background: #1c2431; border: 1px solid #2d384c; border-radius: 6px; color: #9fc2ff; cursor: pointer; font-size: 12px; }
.sdb-go:hover:not(:disabled) { background: #26324a; border-color: #4a6296; }
.sdb-go:disabled { opacity: .3; cursor: default; }
.sdb-missing { font-size: 11.5px; color: var(--warn); background: rgba(240,185,90,.08); border-radius: 6px; padding: 2px 7px; }

.sdb-text { width: 100%; min-height: 2.6em; resize: none; overflow: hidden; background: #131922; border: 1px solid #262f3e; border-radius: 7px; padding: 5px 8px; font: 12.5px/1.55 var(--ui); color: #cbd5e6; outline: none; field-sizing: content; }
.sdb-text:focus { border-color: var(--accent); background: #111720; }
.sdb-text::placeholder { color: var(--faint); }

.sdb-tools { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; opacity: .55; transition: opacity .12s; }
.sdb-card:hover .sdb-tools, .sdb-card:focus-within .sdb-tools, .sdb-card:focus .sdb-tools { opacity: 1; }
.sdb-tools button { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 1px 6px; font-size: 11.5px; color: var(--dim); cursor: pointer; }
.sdb-tools button:hover:not(:disabled) { background: #26324a; border-color: #34405a; color: #fff; }
.sdb-tools button:disabled { opacity: .3; cursor: default; }
.sdb-tools .sdb-sp { flex: 1; }
.sdb-tools .sdb-del:hover { background: #4a2626; border-color: #7a3a3a; color: #ffb3b3; }

/* 끌어 놓기 중 */
.sdb.sdb-dragging .sdb-list { outline: 2px dashed var(--accent2); outline-offset: -4px; border-radius: 8px; }

/* 크게 보기 */
.sdb-lb { z-index: 90; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 2vh 1.5vw; }
.sdb-lb-fig { margin: 0; min-width: 0; max-height: 96vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sdb-lb-img { display: grid; place-items: center; min-height: 0; max-width: 100%; }
.sdb-lb-img img { max-width: 100%; max-height: calc(96vh - 150px); object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: #0e1219; display: block; }
.sdb-lb-none { width: min(640px, 80vw); aspect-ratio: 16 / 9; display: grid; place-items: center; border: 1px dashed #34405a; border-radius: 10px; color: var(--faint); }
.sdb-lb-cap { width: min(900px, 90vw); background: #19202c; border: 1px solid #34405a; border-radius: 12px; padding: 8px 14px; max-height: 130px; overflow-y: auto; font-size: 13.5px; color: #cbd5e6; }
.sdb-lb-top { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; }
.sdb-lb-top b { font: 12px var(--mono); color: #9fc2ff; }
.sdb-lb-warn { color: var(--warn); }
.sdb-lb-text { white-space: pre-wrap; margin-top: 4px; line-height: 1.6; }
.sdb-lb-nav { width: 44px; height: 72px; border-radius: 12px; background: rgba(30,37,49,.85); border: 1px solid #34405a; color: #dde4ef; font-size: 30px; line-height: 1; cursor: pointer; }
.sdb-lb-nav:hover:not(:disabled) { background: #2a3548; border-color: #46567a; }
.sdb-lb-nav:disabled { opacity: .25; cursor: default; }
.sdb-lb-close { position: fixed; top: 14px; right: 18px; width: 36px; height: 36px; border-radius: 50%; background: rgba(30,37,49,.9); border: 1px solid #34405a; color: #dde4ef; cursor: pointer; font-size: 15px; }
.sdb-lb-close:hover { background: #4a2626; border-color: #7a3a3a; }

/* 가져오기 */
.sdb-imp { z-index: 85; }
.sdb-imp-card { width: min(940px, 94vw); line-height: 1.5; }
.sdb-imp-sub { color: var(--dim); margin: 2px 0 12px; font-size: 13px; }
.sdb-imp-card .bad { color: var(--err); }
.sdb-prog { height: 8px; background: #10151d; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 18px 0 8px; }
.sdb-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2d5fb8, var(--accent)); transition: width .2s; }
.sdb-prog-txt { font: 12px var(--mono); color: var(--dim); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdb-imp-table td { vertical-align: middle; }
.sdb-imp-table td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sdb-imp-table select { max-width: 260px; font-size: 13px; padding: 3px 6px; }
.sdb-imp-table tr.skip td:first-child b { color: var(--faint); font-weight: 500; }
.sdb-imp-path { font-size: 11px; color: var(--faint); word-break: break-all; }
.sdb-imp-note { font-size: 11px; color: var(--warn); }
.sdb-imp-note:empty { display: none; }
.sdb-imp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
