:root{
  --cpc-bg:#ffffff;
  --cpc-card:#f8fafc;
  --cpc-text:#0f172a;
  --cpc-muted:#475569;
  --cpc-ring:#e2e8f0;
}
.cpc-wrap{
  max-width:900px;margin:24px auto;padding:20px;border-radius:18px;
  background:var(--cpc-card);box-shadow:0 8px 30px rgba(2,8,23,.06), inset 0 0 0 1px var(--cpc-ring)
}
.cpc-title{margin:0 0 14px;font-weight:800;letter-spacing:.2px;color:var(--cpc-text)}
.cpc-sub{margin:0 0 18px;color:var(--cpc-muted)}
.cpc-grid{
  display:grid;gap:22px;align-items:center;
  grid-template-columns: 1.1fr .9fr;
}
@media (max-width: 720px){
  .cpc-grid{grid-template-columns: 1fr}
}
.cpc-canvas-box{position:relative;width:100%;aspect-ratio:1/1;min-height:280px}
.cpc-canvas-box canvas{width:100%;height:100%;display:block}
.cpc-tip{
  position:absolute;pointer-events:none;transform:translate(-50%,-120%);
  background:#111827;color:#fff;padding:8px 10px;border-radius:10px;
  font-size:14px;white-space:nowrap;box-shadow:0 8px 22px rgba(0,0,0,.2)
}
.cpc-tip::after{
  content:"";position:absolute;left:50%;bottom:-6px;transform:translateX(-50%);
  border:6px solid transparent;border-top-color:#111827
}
.cpc-legend{display:flex;flex-direction:column;gap:10px}
.cpc-legend-item{
  display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:14px;
  background:#fff;box-shadow:0 2px 10px rgba(2,8,23,.05), inset 0 0 0 1px var(--cpc-ring)
}
.cpc-swatch{width:18px;height:18px;border-radius:5px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.cpc-li-title{font-weight:700}
.cpc-li-sub{color:var(--cpc-muted);font-size:14px}
.cpc-total-row{margin-top:8px;padding-top:10px;border-top:1px dashed var(--cpc-ring);color:var(--cpc-muted)}
.cpc-label{
  position:absolute;transform:translate(-50%,-50%);
  font-weight:800;font-size:12px;background:rgba(255,255,255,.85);
  padding:2px 6px;border-radius:999px;box-shadow:0 2px 10px rgba(0,0,0,.08)
}