/* ═══════════════════════════════════════════════
   Box Design — 박스 도면 자동 생성
   ═══════════════════════════════════════════════ */

/* 자연어 입력 바 */
.bd-nl-bar{
  display:flex;gap:10px;margin-bottom:24px;
  padding:12px;border-radius:14px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}
.bd-nl-bar input{
  flex:1;padding:12px 16px;
  background:rgba(0,0,0,.25);color:#fff;
  border:1px solid rgba(255,255,255,.06);border-radius:10px;
  font-size:.9rem;outline:none;
  transition:all .2s;
}
.bd-nl-bar input:focus{
  border-color:rgba(52,211,153,.4);
  box-shadow:0 0 0 3px rgba(52,211,153,.1);
}
.bd-btn-primary{
  padding:12px 20px;border-radius:10px;
  background:linear-gradient(135deg,#34d399,#10b981);
  color:#0a0a0a;border:none;cursor:pointer;
  font-size:.9rem;font-weight:700;
  display:inline-flex;align-items:center;gap:8px;
  transition:all .2s;white-space:nowrap;
}
.bd-btn-primary:hover{transform:translateY(-1px);box-shadow:0 8px 24px rgba(52,211,153,.3)}

/* 작업 영역 */
.bd-work{
  display:grid;grid-template-columns:320px 1fr;gap:20px;margin-bottom:32px;
}
.bd-options{min-width:0}
.bd-preview{min-width:0}

/* 옵션 카드 */
.bd-opt-card{
  background:rgba(255,255,255,.03);border-radius:14px;padding:22px;
  border:1px solid rgba(255,255,255,.06);
}
.bd-opt-title{
  font-size:.9rem;font-weight:700;color:rgba(255,255,255,.85);
  margin-bottom:20px;display:flex;align-items:center;gap:8px;
}
.bd-opt-title i{color:#f59e0b;font-size:.85rem}
.bd-opt-section{margin-bottom:18px}
.bd-opt-section-label{
  font-size:.72rem;font-weight:700;color:#f59e0b;
  text-transform:uppercase;letter-spacing:.5px;margin-bottom:10px;
}
.bd-opt-input{
  width:100%;padding:10px 12px;
  background:rgba(0,0,0,.25);color:#fff;
  border:1px solid rgba(255,255,255,.08);border-radius:8px;
  font-size:.85rem;outline:none;
  transition:border-color .2s;
}
.bd-opt-input:focus{border-color:rgba(245,158,11,.4)}
.bd-opt-input option{background:#14141e;color:#fff}

.bd-opt-dim-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}
.bd-opt-dim label{
  display:block;font-size:.68rem;color:rgba(255,255,255,.5);
  font-weight:600;margin-bottom:4px;
}
.bd-opt-dim input{
  width:100%;padding:9px 10px;
  background:rgba(0,0,0,.25);color:#fff;
  border:1px solid rgba(255,255,255,.08);border-radius:7px;
  font-size:.85rem;font-family:'Inter',monospace;font-weight:600;outline:none;
  transition:border-color .2s;
  -moz-appearance:textfield;
}
.bd-opt-dim input::-webkit-outer-spin-button,
.bd-opt-dim input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.bd-opt-dim input:focus{border-color:rgba(245,158,11,.4)}

.bd-opt-info{
  margin-top:20px;padding:12px;border-radius:10px;
  background:rgba(245,158,11,.05);border:1px solid rgba(245,158,11,.12);
}
.bd-opt-info-row{
  display:flex;justify-content:space-between;align-items:center;
  padding:4px 0;font-size:.78rem;
}
.bd-opt-info-row span:first-child{color:rgba(255,255,255,.55)}
.bd-opt-info-row span:last-child{color:#fbbf24;font-weight:700;font-family:'Inter',monospace}

.bd-btn-save{
  width:100%;margin-top:16px;padding:12px;
  background:rgba(255,255,255,.05);color:rgba(255,255,255,.85);
  border:1px solid rgba(255,255,255,.08);border-radius:10px;
  font-size:.85rem;font-weight:700;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:8px;
  transition:all .2s;
}
.bd-btn-save:hover{
  background:rgba(245,158,11,.1);border-color:rgba(245,158,11,.3);color:#fbbf24;
}

/* 미리보기 */
.bd-preview{
  background:rgba(255,255,255,.03);border-radius:14px;
  border:1px solid rgba(255,255,255,.06);overflow:hidden;
  display:flex;flex-direction:column;
}
.bd-preview-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.05);gap:12px;
}
.bd-preview-info{flex:1;min-width:0}
.bd-preview-info h3{
  font-size:.88rem;font-weight:700;color:rgba(255,255,255,.9);
  margin:0 0 4px;font-family:'Inter',monospace;
}
.bd-legend{display:flex;gap:14px;font-size:.7rem;color:rgba(255,255,255,.5)}
.bd-legend-item{display:flex;align-items:center;gap:5px}
.bd-ldot{display:inline-block;width:14px;height:2px;border-radius:1px}
.bd-ldash{display:inline-block;width:14px;height:0;border-top:1.5px dashed}
.bd-preview-actions{display:flex;gap:6px}

.bd-icon-btn{
  width:34px;height:34px;border-radius:8px;
  background:rgba(255,255,255,.04);color:rgba(255,255,255,.65);
  border:1px solid rgba(255,255,255,.06);cursor:pointer;
  display:flex;align-items:center;justify-content:center;font-size:.82rem;
  transition:all .15s;
}
.bd-icon-btn:hover{background:rgba(245,158,11,.1);color:#fbbf24;border-color:rgba(245,158,11,.25)}

.bd-svg-wrap{
  flex:1;padding:20px;min-height:420px;
  display:flex;align-items:center;justify-content:center;
  overflow:auto;
}
.bd-svg-wrap svg{max-width:100%;height:auto}
.bd-svg-error{color:#f87171;font-size:.85rem}

/* 히스토리 */
.bd-history{margin-bottom:40px}
.bd-history-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:14px;padding:0 4px;
}
.bd-history-head h3{
  font-size:.88rem;font-weight:700;color:rgba(255,255,255,.85);
  margin:0;display:flex;align-items:center;gap:8px;
}
.bd-history-head h3 i{color:#f59e0b;font-size:.78rem}

.bd-history-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px;
}
.bd-history-empty{
  grid-column:1/-1;text-align:center;padding:40px;
  color:rgba(255,255,255,.35);font-size:.85rem;
  background:rgba(255,255,255,.02);border-radius:12px;
}

.bd-hcard{
  background:rgba(255,255,255,.03);border-radius:12px;overflow:hidden;
  border:1px solid rgba(255,255,255,.06);cursor:pointer;
  transition:all .2s;position:relative;
}
.bd-hcard:hover{
  border-color:rgba(245,158,11,.25);
  transform:translateY(-2px);
  box-shadow:0 8px 24px rgba(0,0,0,.2);
}
.bd-hcard-preview{
  height:140px;background:#0b0b12;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.bd-hcard-preview svg{max-width:95%;max-height:95%}
.bd-hcard-body{padding:12px 14px}
.bd-hcard-title{
  font-size:.82rem;font-weight:700;color:rgba(255,255,255,.85);
  margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.bd-hcard-time{font-size:.7rem;color:rgba(255,255,255,.4);font-family:'Inter',monospace}

.bd-hcard-del{
  position:absolute;top:8px;right:8px;
  width:26px;height:26px;border-radius:6px;
  background:rgba(0,0,0,.5);color:rgba(255,255,255,.6);
  border:none;cursor:pointer;font-size:.75rem;
  display:flex;align-items:center;justify-content:center;
  opacity:0;transition:all .15s;
}
.bd-hcard:hover .bd-hcard-del{opacity:1}
.bd-hcard-del:hover{background:rgba(248,113,113,.2);color:#f87171}

/* 토스트 */
.bd-toast{
  position:fixed;bottom:24px;left:50%;transform:translateX(-50%);
  padding:12px 20px;border-radius:10px;
  background:rgba(52,211,153,.15);color:#34d399;
  border:1px solid rgba(52,211,153,.35);
  font-size:.85rem;font-weight:700;z-index:9999;
  animation:bd-toast-in .25s ease-out;
  box-shadow:0 8px 24px rgba(0,0,0,.3);
}
@keyframes bd-toast-in{
  from{opacity:0;transform:translate(-50%,20px)}
  to{opacity:1;transform:translate(-50%,0)}
}

/* 반응형 */
@media (max-width:1024px){
  .bd-work{grid-template-columns:1fr}
  .bd-svg-wrap{min-height:320px}
}
@media (max-width:768px){
  .bd-svg-wrap{min-height:260px;padding:12px}
  .bd-opt-card{padding:16px}
  .bd-preview-head{flex-wrap:wrap;padding:12px 14px}
  .bd-preview-actions{width:100%;justify-content:flex-end}
}
@media (max-width:640px){
  .bd-nl-bar{flex-direction:column;padding:10px}
  .bd-btn-primary{width:100%;justify-content:center}
  .bd-opt-dim-row{grid-template-columns:1fr 1fr}
  .bd-preview-info h3{font-size:.78rem}
  .bd-legend{font-size:.65rem;gap:10px}
  .bd-history-grid{grid-template-columns:1fr 1fr;gap:10px}
  .bd-hcard-preview{height:110px}
}
@media (max-width:420px){
  .bd-history-grid{grid-template-columns:1fr}
  .bd-opt-dim-row{grid-template-columns:1fr}
}
