/* 외부 템플릿 가져오기 (P1-B) — 업로드 시트 + OCR 확인 카드 */
.tpli-overlay {
  position: fixed;
  inset: 0;
  z-index: 99992;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.tpli-overlay.on { display: flex; }
.tpli-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 92vh;
  overflow-y: auto;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom));
}
@media (width >= 768px) {
  .tpli-overlay { align-items: center; }
  .tpli-card { border-radius: 20px; }
}
.tpli-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tpli-head strong { font-size: 17px; color: #191F28; }
.tpli-x {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #8B95A1;
  cursor: pointer;
}
.tpli-desc {
  font-size: 12.5px;
  color: #6B7684;
  line-height: 1.55;
  margin-bottom: 14px;
}
.tpli-desc b { color: #BC6675; }

.tpli-upload {
  border: 2px dashed #E7CEE0;
  border-radius: 16px;
  padding: 30px 16px;
  text-align: center;
  background: #FBF6FA;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.tpli-upload-ic { color: #BC6675; display: inline-flex; }
.tpli-upload-t { font-size: 14px; font-weight: 800; color: #BC6675; }
.tpli-upload-s { font-size: 11px; color: #9AA1AC; }

.tpli-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 0;
  font-size: 13px;
  color: #555;
}
.tpli-spin {
  width: 26px;
  height: 26px;
  border: 3px solid #EBD7E5;
  border-top-color: #BC6675;
  border-radius: 50%;
  animation: tpli-spin 0.8s linear infinite;
}
@keyframes tpli-spin { to { transform: rotate(360deg); } }

.tpli-result { margin-top: 6px; }
.tpli-okhead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.tpli-okhead strong { font-size: 15.5px; color: #166534; }
.tpli-count {
  font-size: 12px;
  font-weight: 700;
  color: #16A34A;
  background: #DCFCE7;
  padding: 2px 9px;
  border-radius: 999px;
}
.tpli-meta { font-size: 12px; color: #6B7684; margin-bottom: 8px; }
.tpli-warn {
  font-size: 12px;
  color: #92400E;
  background: #FEF3C7;
  border-radius: 10px;
  padding: 8px 11px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.tpli-list {
  border: 1px solid #F0F0F0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}
.tpli-srow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid #F5F5F5;
}
.tpli-srow:last-child { border-bottom: none; }
.tpli-sname { font-size: 13px; font-weight: 600; color: #333; overflow-wrap: anywhere; }
.tpli-sprice { font-size: 13.5px; font-weight: 700; color: #BC6675; white-space: nowrap; }
/* 가격을 못 읽은 행 — 버리지 않고 '가격 확인 필요'로 표시 */
.tpli-srow-need { background: #FFF8EC; }
.tpli-sprice-need { color: #B26B00; font-weight: 600; font-size: 12px; }
/* [U1] 가격은 읽었으나 인식이 흐린 행 — 가격 유지 + '확인' 태그 */
.tpli-srow-lowconf { background: #FFFBF0; }
.tpli-sprice-lowconf { color: #8A6D3B; }
.tpli-lowtag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: #F0D9A8; color: #7A5B16; font-size: 10.5px; font-weight: 700; vertical-align: middle; }
.tpli-more { padding: 9px 13px; font-size: 11.5px; color: #9AA1AC; text-align: center; }

.tpli-raw { margin-bottom: 12px; }
.tpli-raw summary {
  font-size: 11.5px;
  color: #9AA1AC;
  cursor: pointer;
  list-style: revert;
}
.tpli-raw > div {
  margin-top: 6px;
  font-size: 11px;
  color: #8B95A1;
  line-height: 1.5;
  background: #F7F8FA;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tpli-err {
  font-size: 13px;
  color: #991B1B;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 12px;
  padding: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.tpli-actions { display: flex; flex-direction: column; gap: 8px; }
.tpli-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #BC6675, #D58A95);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
}
.tpli-secondary {
  width: 100%;
  padding: 14px;
  border: 1px solid #DDD;
  border-radius: 14px;
  background: #fff;
  color: #555;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.tpli-ghost {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: #F2F4F6;
  color: #6B7684;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
